mtn-momo-client
Version:
A collection of utils to interact with the mtn-momo api
23 lines (22 loc) • 1.15 kB
TypeScript
import { AxiosInstance } from 'axios';
import { Product, TargetEnvironment } from '../types';
type CreateTokenClientOptions = {
/** The product you want to generate an authentication token for */
targetProduct: Product;
/** Subscription key which provides access to a target product API. Its is the primary key of each product */
subscriptionKey: string;
/** The environment we are targeting. Can either be 'sandbox or production' */
targetEnvironment: TargetEnvironment;
/** The id of the api user */
userId: string;
/** The apiKey of the user */
apiKey: string;
};
/**
* Creates a client to use when generating authentication tokens. Ensures a single client is created for the same product.
* @param {CreateTokenClientOptions} options options to use when creating a token generating client
* @returns {AxiosInstance} the client you can use to talk to token generation endpoints
*/
declare const createTokenClient: ({ subscriptionKey, targetEnvironment, targetProduct, userId, apiKey, }: CreateTokenClientOptions) => AxiosInstance;
export { createTokenClient };
export type { CreateTokenClientOptions };