Last active
February 6, 2022 11:40
-
-
Save justlev/ebe0dd7eb8bb9f84c4ec0639b17db795 to your computer and use it in GitHub Desktop.
Integrate once & forget
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {StatewizeClient} from "statewize-client-sdk"; | |
const sdk = new StatewizeClient(process.env.STW_TOKEN); | |
// Report an action, along with its state (start/finished/failed): | |
await sdk.reportEvent({ slug: `checkout-express`, type: 'finished', | |
// Optionally, add data attachments that will help you debug | |
attachments: [{ | |
type: 'object', // can be any object, file or text you like | |
content: { object: { res, errors, whatever }}}] | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment