amocrm-api-nodejs
v0.1.3
Published
Amocrm APIs Client Library for Node.js
Downloads
2
Maintainers
Readme
Amocrm APIs Node.js Client
Create client index.ts
import { Amocrm } from "amocrm-api-nodejs";
const client = new Amocrm.Api({
tokenResolver(): Promise<string> {
const token = getAccessToken();
return Promise.resolve(token.access_token);
},
domain: process.env.AMO_DOMAIN,
client_secret: process.env.AMO_CLIENT_SECRET || '',
client_id: process.env.AMO_CLIENT_ID || '',
redirect_uri: process.env.AMO_REDIRECT_URL || '',
code: process.env.AMO_CODE || '',
});
(async function() {
try {
const responseAccount = await client.account.with(['users', 'task_types', 'pipelines', 'note_types', 'groups', 'custom_fields']);
console.dir(responseAccount, {depth: 10, colors: true})
} catch (error) {
console.dir(error, {depth:11, colors: true});
}
})();