Create a new project
Create a new directory and initialize a new npm package.- TypeScript
Install TypeScript and the Node.js type definitions.
Install the Formance SDK
Install the Formance SDK and the Formance OAuth helper:The Formance API relies on OAuth 2.0 for authentication. The Formance OAuth helper simplifies the OAuth flow and provides a simple interface to obtain an access token using the
client_credentials grant type. For more information, see OAuth 2.0.The Formance OAuth helper uses the
client_credentials grant type, which requires a client ID and client secret. These are sensitive credentials and should not be exposed to the public. If you’re integrating Formance into a web application, you should use an OAuth flow that does not require a client secret, such as the authorization code grant.Hello World from the Formance Ledger
Replace the values with your API endpoint and credentials from the Authentication & Credentials Setup guide.
- TypeScript
- JavaScript
Create a new file Run the file using
index.ts and add the following code:ts-node: