Authentication
Export your API key as an env var. Seam client libs will automatically pick it up. For example:
$ export SEAM_API_KEY=seam_test2ZTo_0mEYQW2TvNDCxG5Atpj85Ffw
Next, run the code below to check you are correctly authenticated:
// Replace with
// const Seam = require("seamapi")
// if not using ES6 modules and/or TypeScript.
import Seam from "seamapi";
// Seam will automatically use the SEAM_API_KEY environment variable if you
// don't provide an apiKey to `new Seam()`
const seam = new Seam();
const checkAuth = async () => {
const { workspace } = await seam.workspaces.get();
console.log(workspace);
}
checkAuth();
/*
{
workspace_id: 'ab804f5a-7dd2-42c8-8d09-0beff4f795eb',
name: 'Sanbox',
connect_partner_name: 'Acme',
is_sandbox: true
}
*/
Last updated
Was this helpful?