npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@chain1/auth-storage

v1.0.0

Published

Secure authentication and storage utilities for chain wallet app

Readme

@chain1/stok-auth-storage

Secure authentication and storage utilities for STOK chain wallet app.

Installation

npm install @chain1/stok-auth-storage
# or
yarn add @chain1/stok-auth-storage

Requirements

This package requires the following peer dependencies:

  • @react-native-async-storage/async-storage >= 1.15.0
  • react-native-device-info >= 8.7.1

Usage

User Authentication

import {
  saveUserId,
  getUserId,
  saveMbId,
  getMbId,
  saveSession,
  getSession,
  clearUserData
} from '@chain1/stok-auth-storage';

// Save user ID
await saveUserId('user-uuid-123');

// Get user ID
const userId = await getUserId();

// Save member ID
await saveMbId('member-123');

// Get member ID
const mbId = await getMbId();

// Save session
await saveSession({ access_token: 'token', refresh_token: 'refresh' });

// Get session
const session = await getSession();

// Clear all user data
await clearUserData();

Login Time Tracking

import { saveLoginTime, getLoginTime } from '@chain1/stok-auth-storage';

// Save current login time
await saveLoginTime();

// Get last login timestamp
const lastLogin = await getLoginTime();
console.log(new Date(lastLogin));

Device Management

import { saveDeviceUuid, getDeviceUuid } from '@chain1/stok-auth-storage';

// Save device UUID
const deviceId = await saveDeviceUuid();

// Get device UUID (auto-saves if not exists)
const uuid = await getDeviceUuid();

Generic Storage

import { saveData, getData, removeData, getAllData } from '@chain1/stok-auth-storage';

// Save any data
await saveData('my_key', 'my_value');

// Get data
const value = await getData('my_key');

// Remove data
await removeData('my_key');

// Get all stored data
const allData = await getAllData();

API Reference

User Management

  • saveUserId(userId) - Save user UUID
  • getUserId() - Get user UUID
  • saveMbId(mbId) - Save member ID
  • getMbId() - Get member ID
  • clearUserData() - Clear all user data

Session Management

  • saveSession(session) - Save session object
  • getSession() - Get session object

Login Tracking

  • saveLoginTime() - Save current timestamp
  • getLoginTime() - Get last login timestamp

Device Management

  • saveDeviceUuid() - Save and return device UUID
  • getDeviceUuid() - Get device UUID (auto-save if not exists)

Generic Storage

  • saveData(key, value) - Save any key-value pair
  • getData(key) - Get value by key
  • removeData(key) - Remove data by key
  • getAllData() - Get all stored key-value pairs

License

MIT