Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@localazy/generic-connector-client

Package Overview
Dependencies
Maintainers
4
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@localazy/generic-connector-client

Node.js module that allows to interact with the Localazy Generic Connector.

  • 0.2.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
110
decreased by-26.67%
Maintainers
4
Weekly downloads
 
Created
Source

📦 Localazy Generic Connector Client

Node.js module that allows to interact with the Localazy Generic Connector.

🔧 Install

npm install @localazy/generic-connector-client
# or you can use yarn or pnpm

🚀 Usage

ESM
import { GenericConnectorClient, getOAuthAuthorizationUrl } from '@localazy/generic-connector-client';

const api = new GenericConnectorClient({ pluginId: 99 }); // Create Api client with your `pluginId`

const keys = await GenericConnectorClient.public.keys(); // Get read and write keys for OAuth.
const url = getOAuthAuthorizationUrl({
  clientId: 'your-client-id',
  customId: 'your-write-key',
}); // Get OAuth authorization URL.
window.open(url);
const pollResult = await GenericConnectorClient.oauth.continuousPoll({
  readKey: keys.readKey,
}); // Poll for the result.

console.log(pollResult); // Print the result with access token.
TypeScript
import { GenericConnectorClient, getOAuthAuthorizationUrl, GeneratedKeys, PollResponseCompleted } from '@localazy/generic-connector-client';

const api: GenericConnectorClient = new GenericConnectorClient({ pluginId: 99 });             // Create Api client with your `pluginId`

const keys: GeneratedKeys = await GenericConnectorClient.public.keys();              // Get read and write keys for OAuth.
const url: string = getOAuthAuthorizationUrl({
  clientId: 'your-client-id',
  customId: 'your-write-key',
});                                                                   // Get OAuth authorization URL.
window.open(url);
const pollResult: PollResponseCompleted = await GenericConnectorClient.oauth.continuousPoll({
  readKey: keys.readKey,
});                                                                   // Poll for the result.

console.log(pollResult);                                              // Print the result with access token.

Keywords

FAQs

Package last updated on 22 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc