
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@jaw.id/passkeys
Advanced tools
A minimal TypeScript package for passkey management with configurable backend support. Use the default JAW passkey service or self-host your own compatible server.
import { configurePasskeys, createPasskey, loginWithPasskey } from '@jaw.id/passkeys'
// Configure for JAW service (requires API key)
configurePasskeys({
apiKey: 'your-justaname-api-key'
})
// Or configure for custom server (no API key needed)
configurePasskeys({
serverUrl: 'https://your-passkey-server.com/api/passkeys'
})
apiKeyserverUrl, apiKey is optionalThe package validates configuration automatically:
Your passkey server must implement the following endpoints and data structures to be compatible:
/ - Lookup Passkeys by Credential IDsRetrieves passkey information for one or more credential IDs.
Query Parameters:
credentialIds (string[], repeatable): Array of credential IDs to lookupResponse Format:
{
"statusCode": 200,
"result": {
"data": {
"passkeys": [
{
"credentialId": "string",
"publicKey": "0x...",
"displayName": "string"
}
]
},
"error": null
}
}
Note: publicKey must be hex-encoded with 0x prefix.
Error Response (404):
{
"statusCode": 404,
"result": {
"data": null,
"error": "Passkeys not found"
}
}
/ - Register a New PasskeyRegisters a new passkey credential.
Request Body:
{
"credentialId": "string",
"publicKey": "0x...",
"displayName": "string"
}
Note: publicKey must be hex-encoded with 0x prefix.
Headers:
Content-Type: application/jsonResponse:
0xWhen implementing your own passkey server:
const express = require('express');
const app = express();
// In-memory storage (use a proper database in production)
const passkeys = new Map();
// Lookup passkeys
app.get('/api/passkeys', (req, res) => {
const credentialIds = req.query.credentialIds || [];
const ids = Array.isArray(credentialIds) ? credentialIds : [credentialIds];
const foundPasskeys = ids
.map(id => passkeys.get(id))
.filter(Boolean);
if (foundPasskeys.length === 0) {
return res.status(404).json({
statusCode: 404,
result: {
data: null,
error: 'Passkeys not found'
}
});
}
res.json({
statusCode: 200,
result: {
data: {
passkeys: foundPasskeys
},
error: null
}
});
});
// Register passkey
app.post('/api/passkeys', express.json(), (req, res) => {
const { credentialId, publicKey, displayName } = req.body;
if (!credentialId || !publicKey || !displayName) {
return res.status(400).json({
statusCode: 400,
result: {
data: null,
error: 'Missing required fields'
}
});
}
passkeys.set(credentialId, {
credentialId,
publicKey,
displayName
});
res.status(201).send();
});
app.listen(3000);
import { createPasskey } from '@jaw.id/passkeys'
try {
const passkey = await createPasskey('My Passkey')
console.log('Created passkey:', passkey.id)
} catch (error) {
console.error('Failed to create passkey:', error)
}
import { loginWithPasskey, loginWithSpecificPasskey } from '@jaw.id/passkeys'
// Login with native passkey selector
const passkey = await loginWithPasskey()
// Login with specific passkey ID
const specificPasskey = await loginWithSpecificPasskey('credential-id')
import {
checkAuth,
storePasskeyAccount,
fetchAccountsFromLocalStorage
} from '@jaw.id/passkeys'
// Check authentication status
const authResult = await checkAuth()
console.log('Is authenticated:', authResult.isAuthenticated)
// Get stored accounts
const accounts = fetchAccountsFromLocalStorage()
To verify your server is compatible:
configurePasskeys()If no configuration is provided, the package defaults to the JustaName passkey service at https://api.justaname.id/wallet/v2/passkeys. When using the default service, you must provide an API key:
configurePasskeys({
apiKey: 'your-justaname-api-key'
})
FAQs
TypeScript package for WebAuthn passkey management
We found that @jaw.id/passkeys demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.