runik
TypeScript icon, indicating that this package has built-in type declarations

0.3.17 • Public • Published

banner

Runik SDK

Built for Runik API v0.3.9

Lines of code Discord Downloads

Usage

import { Client, Users } from 'runik'
const client = new Client()
	.setEndpoint('http://localhost:9000/api/v1')
	.setKey('API_KEY')
const users = new Users(client)

// Get all users
await users.get()

// Create user
await users.signUp(
	'infrared.studio@skiff.com',
	'myPassword',
	'http://localhost:5173/verify'
)

// Login to user
const user = await users.signIn('infrared.studio@skiff.com', 'myPassword', true) // set true to make the session expire

// Get logged in user
await user.get()

// Get user sessions
await user.getSessions()

// Update signed in users email
await user.updateEmail('newemail@example.com', 'http://localhost:5173/verify')

// Update signed in users password
await user.updatePassword('myPassword', 'newPassword')

// Sign out on all devices
await user.deleteSessions('myPassword')

// Sign out of current session
await user.signOut()

// Delete signed in user
await user.delete('myPassword')

Readme

Keywords

none

Package Sidebar

Install

npm i runik

Weekly Downloads

1

Version

0.3.17

License

ISC

Unpacked Size

21.2 kB

Total Files

14

Last publish

Collaborators

  • infrareddevs