Getting Started
The Paymongo API Client helps you with communicating with the Paymongo servers. It's fully typed, so you can get great intellisense.
#
Installation- npm
- yarn
npm install @paymongo/core
yarn add @paymongo/core
#
Create a Paymongo instance- Typescript
- JavaScript
import Paymongo, { SecretKey } from '@paymongo/core';
const paymongo = new Paymongo(process.env.PAYMONGO_SECRET_KEY as SecretKey);
import Paymongo from '@paymongo/core';
const paymongo = new Paymongo(process.env.PAYMONGO_SECRET_KEY);
note
It can also be used in the browser.
- Typescript
- JavaScript
import Paymongo, { PublicKey } from '@paymongo/core';
const paymongo = new Paymongo(process.env.PAYMONGO_PUBLIC_KEY as PublicKey);
import Paymongo from '@paymongo/core';
const paymongo = new Paymongo(process.env.PAYMONGO_PUBLIC_KEY);
caution
DO NOT USE YOUR SECRET KEY IN A BROWSER ENVIRONMENT.