@replit/repl-auth
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Repl Authentication

Repl Authentication is a simple way to allow users to log in, and access their information.

Get started

Ensure that a user is logged in with replit following our docs

const express = require('express'); 
const { getUserInfo } = require('../index.js')

const app = express();
app.use(express.static('public'));

app.get('/', async function(req, res) {
  const userInfo = getUserInfo(req)
  console.log(userInfo)
}

Docs

getUserInfo(Request req)

Gets all user info. Returns UserInfo object.

const userInfo = getUserInfo(req)

UserInfo object:

UserInfo {
  id?: string;
  name?: string;
  bio?: string;
  url?: string;
  profileImage?: string;
  roles?: Array<string>
  teams?: Array<string>
}

Tests

npm run test

Then login and assure that it says "server tests passed"

Readme

Keywords

none

Package Sidebar

Install

npm i @replit/repl-auth

Weekly Downloads

24,887

Version

1.0.0

License

ISC

Unpacked Size

15.3 kB

Total Files

16

Last publish

Collaborators

  • krishatreplit
  • mikewesthad
  • motzyball
  • juan.replit
  • ahulbert-replit
  • james-addison-replit
  • replitdstewart
  • ryanweingast
  • harryatreplit
  • theflowingsky
  • jonesit-replit
  • szymon_k
  • cdmistman
  • jackyzha0
  • jamesaustinreplit
  • lopezhoracio
  • bradymaddenreplit
  • ryantm
  • alexisreplit
  • ink404
  • brianpool
  • tobyho
  • brenoafb
  • masad-frost
  • lincolnreplit
  • stkenned
  • replitmatt
  • cbrewster
  • ltazmin_replit
  • moudy
  • schestakov
  • lhchavez
  • slmjkdbtl
  • lunaroyster