Socket
Socket
Sign inDemoInstall

replit-identity

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

replit-identity

A simple package to interact with the Replit CLI's identity command.


Version published
Weekly downloads
18
decreased by-57.14%
Maintainers
1
Weekly downloads
 
Created
Source

Replit Identity

Supports TypeScript

Create and verify Replit Identity tokens.

NPM Version NPM Install Size NPM Downloads

const { create, verify } = require('replit-identity');

const audience = 'target-repl-id';
const token = await create(audience);

const info = await verify(token, audience);
console.log(info);

Installation

npm install replit-identity

Important: This package can only be used within a Replit environment.

API

The replit-identity module exports the following functions:

create

Creates a new identity token.

  • param: audience (string): The target audience for the token.
  • returns: A Promise resolving to the string token, or null on error.

verify

Verifies an existing identity token.

  • param: token (string): The token to verify.
  • param: audience (string): The audience to verify against.
  • returns: A Promise resolving to an object containing token information, or null if the token is invalid.

Example return value:

const info = {
  slug: "repl-name", 
  replId: "unique-repl-id",
  audience: "target-repl-id", 
  username: "jane_doe" ,
  userId: 12345,
  runtime: {
    // Based on Replit environment:
    interactive: {
      cluster: 'example-cluster',
      subcluster: 'example-subcluster'
    },
    // Or:
    hosting: {
      cluster: 'example-cluster',
      subcluster: 'example-subcluster'
    },
    // Or (if in deployment):
    deployment: true,
  }
}

Keywords

FAQs

Package last updated on 16 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