@usedatabrew/nodejs-sdk
v0.0.2
Published
NodeJS SDK provides a simple way to connect to streaming pipelines to receive payment events from created DataBrew's pipelines.
Downloads
27
Maintainers
Readme
DataBrew NodeJS Stream SDK
NodeJS SDK provides a simple way to connect to streaming pipelines to receive payment events from created DataBrew's pipelines.
Installation
npm install @usedatabrew/nodejs-sdk
Usage
import { MessageFrame, StreamSdk } from '@usedatabrew/nodejs-sdk';
const sdk = new StreamSdk({
apiKey: 'your-api-key'
});
sdk.subscribe('your-pipeline-id', {
onError: (err) => console.log(err),
onData: async (data: MessageFrame) => {
console.log('Data received', data);
},
});
API
Stripe Streams
In order to include more Stripe Connect accounts to your stream you need to use addStripeConnectedAccounts
method
Example
await sdk.addStripeConnectedAccounts('connector-id', ['acct_xxxxxxx']);