📦 Localazy Generic Connector Client
Node.js module that allows to interact with the Localazy Generic Connector.
🔧 Install
npm install @localazy/generic-connector-client
🚀 Usage
ESM
import { GenericConnectorClient, getOAuthAuthorizationUrl } from '@localazy/generic-connector-client';
const api = new GenericConnectorClient({ pluginId: 99 });
const keys = await GenericConnectorClient.public.keys();
const url = getOAuthAuthorizationUrl({
clientId: 'your-client-id',
customId: 'your-write-key',
});
window.open(url);
const pollResult = await GenericConnectorClient.oauth.continuousPoll({
readKey: keys.readKey,
});
console.log(pollResult);
TypeScript
import { GenericConnectorClient, getOAuthAuthorizationUrl, GeneratedKeys, PollResponseCompleted } from '@localazy/generic-connector-client';
const api: GenericConnectorClient = new GenericConnectorClient({ pluginId: 99 });
const keys: GeneratedKeys = await GenericConnectorClient.public.keys();
const url: string = getOAuthAuthorizationUrl({
clientId: 'your-client-id',
customId: 'your-write-key',
});
window.open(url);
const pollResult: PollResponseCompleted = await GenericConnectorClient.oauth.continuousPoll({
readKey: keys.readKey,
});
console.log(pollResult);