Registry / security / wax-auth-client

wax-auth-client

JSON →
library1.0.0jsnpmunverified

Wax Auth Client v1.0.0 is a JavaScript/TypeScript library for authenticating users on the WAX blockchain using Anchor wallets. It provides a simplified login flow with token management, supporting both browser and Node.js environments. Published on npm with built-in TypeScript definitions, it is actively maintained by the WAX community. Unlike general blockchain auth libraries, it is tailored specifically for WAX and Anchor, offering streamlined integration with minimal boilerplate.

npm install wax-auth-client
INSTALL
IMPORT
SIG · WAX-AUTH-CLIENT
W
wax-auth-client
securityjavascriptv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

WaxAuthClient
import { WaxAuthClient } from 'wax-auth-client'
const WaxAuthClient = require('wax-auth-client')
ESM-only; TypeScript types included.
WaxAuthClient (default)
import WaxAuthClient from 'wax-auth-client'
const WaxAuthClient = require('wax-auth-client').default
Default export is also available; use named import for better tree-shaking.
WaxAuthConfig
import type { WaxAuthConfig } from 'wax-auth-client'
import { WaxAuthConfig } from 'wax-auth-client'
This is a type only; use `import type` in TypeScript.

Shows initialization of WaxAuthClient with required endpoints and a basic login function.

import { WaxAuthClient } from 'wax-auth-client'; const client = new WaxAuthClient({ appName: 'MyApp', waxEndpoint: 'https://wax.greymass.com', anchorEndpoint: 'https://anchor-protocol.io' }); async function login() { try { const user = await client.login(); console.log('Logged in as:', user.wallet); return user; } catch (err) { console.error('Login failed:', err); } } login();
Debug
Known issues
gotchaThe `waxEndpoint` and `anchorEndpoint` must be HTTPS URLs; using HTTP will cause mixed content errors in browsers.
fix
Use HTTPS URLs for both endpoints.
affects: >=1.0.0
gotchaThe library requires the Anchor wallet browser extension to be installed; otherwise login will throw an error.
fix
Check for Anchor wallet availability before calling login().
affects: >=1.0.0
deprecatedThe `waxEndpoint` option is deprecated as of v1.0.0 and will be removed in v2. Use `chainId` instead.
fix
Replace `waxEndpoint` with `chainId: '1064487b3cd1a897ce03ae5b6a865651747e2e152090f99c1b19d9e1d4c1b3c3'`.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'wax-auth-client'
Package not installed or missing from node_modules.
fix
Run `npm install wax-auth-client` or `yarn add wax-auth-client`.
TypeError: WaxAuthClient is not a constructor
Using default import when package exports only named export, or vice versa.
fix
Use `import { WaxAuthClient } from 'wax-auth-client'` (named export).
Uncaught (in promise) Error: Anchor wallet not detected
Anchor browser extension is not installed or not enabled.
fix
Install the Anchor wallet extension and ensure it is activated.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
32 hits · last 30 days
node
30
OpenAI (training)
1
Resources
wax-auth-client — npm install wax-auth-client · libregistry