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

@workos-inc/node

Package Overview
Dependencies
Maintainers
5
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@workos-inc/node

A Node wrapper for the WorkOS API

  • 0.2.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
419K
decreased by-6.77%
Maintainers
5
Weekly downloads
 
Created

What is @workos-inc/node?

@workos-inc/node is an SDK for integrating with WorkOS, a platform that provides enterprise-ready features such as Single Sign-On (SSO), Directory Sync, and Audit Logs. This package allows developers to easily integrate these features into their Node.js applications.

What are @workos-inc/node's main functionalities?

Single Sign-On (SSO)

This feature allows you to generate an SSO authorization URL for a specified provider, such as Google OAuth. The code sample demonstrates how to initialize the WorkOS client and generate an SSO URL.

const { WorkOS } = require('@workos-inc/node');
const workos = new WorkOS('your_api_key');

async function getSSOUrl() {
  const ssoUrl = await workos.sso.getAuthorizationURL({
    clientID: 'your_client_id',
    redirectURI: 'your_redirect_uri',
    state: 'optional_state',
    provider: 'GoogleOAuth'
  });
  console.log(ssoUrl);
}

getSSOUrl();

Directory Sync

This feature allows you to list all directories that have been synchronized with WorkOS. The code sample demonstrates how to initialize the WorkOS client and list the directories.

const { WorkOS } = require('@workos-inc/node');
const workos = new WorkOS('your_api_key');

async function listDirectories() {
  const directories = await workos.directorySync.listDirectories();
  console.log(directories);
}

listDirectories();

Audit Logs

This feature allows you to create an audit log event for tracking user actions. The code sample demonstrates how to initialize the WorkOS client and create an audit log event.

const { WorkOS } = require('@workos-inc/node');
const workos = new WorkOS('your_api_key');

async function createAuditLogEvent() {
  const event = await workos.auditLogs.createEvent({
    organization: 'your_organization_id',
    event: {
      action: 'user.login',
      occurred_at: new Date().toISOString(),
      actor: {
        id: 'user_id',
        type: 'user'
      },
      targets: [{
        id: 'target_id',
        type: 'user'
      }],
      context: {
        location: '127.0.0.1',
        user_agent: 'Mozilla/5.0'
      }
    }
  });
  console.log(event);
}

createAuditLogEvent();

Other packages similar to @workos-inc/node

Keywords

FAQs

Package last updated on 19 Mar 2020

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