Skip to content

Session Keys

Varity Team Core Contributors Updated March 2026

Session keys are temporary permissions that let your app perform actions on behalf of a user without requiring approval for every single action. Think of them like scoped API tokens, but for user operations within your app.

When available, session keys will enable:

  • Batch operations — Execute multiple actions in a single step
  • Background actions — Perform tasks without repeated user prompts
  • Scoped permissions — Limit exactly what actions a session can perform
  • Time-limited access — Permissions automatically expire after a set duration

Session keys are planned for a future release. The underlying infrastructure is in place, and the session key API will be added on top of it.

FeatureStatus
User authenticationAvailable now
Automatic action handlingAvailable now
Temporary scoped permissionsPlanned
Batch operationsPlanned

Use the standard authentication system. Users sign in once, and your app handles actions automatically with no extra prompts:

src/components/UserActions.tsx
import { useAuth } from '@varity-labs/ui-kit';
function UserActions() {
const { authenticated } = useAuth();
if (!authenticated) {
return <p>Please sign in first</p>;
}
return (
<div>
<p>You are signed in.</p>
<p>Actions are handled automatically.</p>
</div>
);
}

The following is an early preview of the planned session key API. This is not yet available and subject to change.

// PLANNED -- NOT YET AVAILABLE
// import { useSessionKeys } from '@varity-labs/ui-kit';
function SessionExample() {
const { createSession, revokeSession } = useSessionKeys();
const handleCreate = async () => {
const session = await createSession({
permissions: ['read', 'write', 'update'],
duration: 3600, // seconds
maxActions: 100,
});
console.log('Session created:', session.id);
};
return <button onClick={handleCreate}>Create Session</button>;
}