/volcano:volcano-authfrom volcano
Use for Volcano authentication and identity work including user accounts, email or password sign-up and sign-in, OAuth, sessions, anonymous users, password recovery, and private or per-user data.
Ships in volcano. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Implement robust Volcano authentication journeys with session lifecycle correctness. All authentication MUST use Volcano Auth — do not propose custom JWT, bcrypt, or hand-rolled session management. Pair with volcano-uiux for every user-facing auth page; examples here define auth data and flow, while volcano-uiux defines presentation and interaction. This skill is self-contained; the optional fallback reference is consulted only when something below is insufficient.
Use the project's language:
| Project signal | Session read and adoption | Hosted auth | Failure model |
|---|---|---|---|
package.json, .ts, .js | getSession() / setSession() | browser redirect and automatic state validation | result envelopes |
pyproject.toml, requirements.txt, .py | get_session() / set_session() | server state and explicit adoption | typed exceptions |
Gemfile, .gemspec, .rb | current_session getter / setter | server state and explicit adoption | typed exceptions |
Examples without a language heading use JavaScript or TypeScript. Keep the same user-visible loading, error, and success states in Python and Ruby web frameworks.
volcano.initialize() in a JavaScript browser app; explicitly load and adopt a complete session in Python or Ruby server code.When the prompt doesn't say what the signup/login pages should look like or do, default to this instead of leaving them unstyled or asking a clarifying question:
error.message, and a link to the login page.signUp call, show a visible success alert/banner on the signup page — e.g. "Signup successful! Check your email to verify your account." — before navigating away. Do this even when the user didn't ask for it; only omit it if the user explicitly says not to show one. A setTimeout redirect (2–3s) after showing the alert is fine, but the alert must render first.// Minimal default signup page with a success alert
'use client';
import { useState } from 'react';
import { getVolcano } from '@/lib/volcano';
export default function SignupPage() {
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const [error, setError] = useState<string | null>(null);
const [success, setSuccess] = useState(false);
const [submitting, setSubmitting] = useState(false);
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
if (submitting) return;
setError(null);
setSubmitting(true);
const { error } = await getVolcano().auth.signUp({ email, password });
setSubmitting(false);
if (error) {
setError(error.message);
return;
}
setSuccess(true); // drives the default "Signup success" alert below
};
return (
<div>
{success && (
<div role="alert">Signup successful! Check your email to verify your account.</div>
)}
{error && <div role="alert">{error}</div>}
<form onSubmit={handleSubmit}>
<label htmlFor="signup-email">Email</label>
<input id="signup-email" type="email" autoComplete="email" value={email} onChange={(e) => setEmail(e.target.value)} required />
<label htmlFor="signup-password">Password</label>
<input id="signup-password" type="password" autoComplete="new-password" value={password} onChange={(e) => setPassword(e.target.value)} required />
<button type="submit" disabled={submitting} aria-busy={submitting}>
{submitting ? 'Signing up…' : 'Sign Up'}
</button>
<span role="status">{submitting ? 'Creating account…' : ''}</span>
</form>
<a href="/login">Already have an account? Log in</a>
</div>
);
}
import { VolcanoAuth } from '@volcano.dev/sdk';
const volcano = new VolcanoAuth({
apiUrl: process.env.NEXT_PUBLIC_VOLCANO_API_URL!,
anonKey: process.env.NEXT_PUBLIC_VOLCANO_ANON_KEY!,
});
volcano.database(process.env.NEXT_PUBLIC_VOLCANO_DATABASE!);
Service keys (prefix sk-) are server-only; using one in anonKey from a browser environment throws.
const { user, session, error } = await volcano.auth.signUp({
email: '[email protected]',
password: 'secure-password-123',
metadata: { full_name: 'Alice', avatar_url: '...' }, // optional
});
if (error) {
if (error.message.includes('already exists')) /* email taken */;
else if (error.message.includes('password must')) /* strengthen — real messages: "password must be at least 15 characters", "...contain at least one uppercase letter", etc. */;
else if (error.message.includes('invalid email')) /* validate */;
return;
}
// metadata is stored on user.user_metadata
const { user, session, error } = await volcano.auth.signIn({ email, password });
if (error) {
if (error.message.includes('invalid email or password')) /* wrong creds */;
else if (error.message.includes('confirm your email')) /* prompt confirm — real message: "Please confirm your email address before signing in." */;
else if (error.message.includes('rate limit')) /* rate-limited — real message: "rate limit exceeded, try again later" */;
return;
}
// SDK auto-stores tokens in localStorage (browser) and schedules refresh.
const { error } = await volcano.auth.signOut();
// Clears local session and invalidates the refresh token server-side.
const user = volcano.auth.user();
// Returns the cached User or null. Does not hit the network.
const { user, error } = await volcano.auth.getUser();
const {
data: { session },
error,
} = await volcano.auth.getSession();
if (session?.refresh_token && session.user) {
const { error: adoptError } = await anotherClient.auth.setSession(session);
}
getSession() reads a local snapshot without a request. setSession() requires
a complete access token, refresh token, and user.
session = source.auth.get_session()
if session is not None:
fresh.auth.set_session(session)
session = source.auth.current_session
fresh.auth.current_session = session if session
All three SDKs copy a complete session into memory without a request,
persistence, or auth-state notification. Python raises ValueError and Ruby
raises ArgumentError for an incomplete session; JavaScript returns an error in
its result envelope.
const { user, error } = await volcano.initialize();
// Returns the restored user, or null if no valid session exists.
const unsubscribe = volcano.auth.onAuthStateChange((user) => {
if (user) showApp(user); else showLogin();
});
// Fires once immediately with current state, then on every change.
// Always call unsubscribe() on teardown.
const { session, error } = await volcano.auth.refreshSession();
// Tokens auto-refresh; call this only for explicit forced rotation.
Use the hosted login or signup page when the application does not need its own auth form. Every language must bind the returned session to a one-time state value. Never build the hosted URL by hand.
volcano.auth.signInWithHostedAuth();
volcano.auth.signInWithHostedAuth({ action: 'signup' });
// Get the URL without navigating immediately.
const url = volcano.auth.getHostedAuthUrl();
window.location.assign(url);
The browser SDK creates, stores, and validates the state value. Pass
{ projectId } when the anon key is opaque. Configure the project's
post_auth_redirect_url, then call volcano.initialize() on the returned page.
import secrets
hosted_state = secrets.token_urlsafe(32)
hosted_url = client.auth.get_hosted_auth_url(
project_id=project_id, action="signup", state=hosted_state
)
# Store hosted_state in the user's signed server-side session before redirecting.
session = client.auth.adopt_hosted_auth_session(
returned_session, state=returned_state, expected_state=hosted_state
)
require "securerandom"
hosted_state = SecureRandom.urlsafe_base64(32)
hosted_url = client.auth.get_hosted_auth_url(
project_id: project_id, action: "signup", state: hosted_state
)
# Store hosted_state in the user's signed server-side session before redirecting.
session = client.auth.adopt_hosted_auth_session(
returned_session, state: returned_state, expected_state: hosted_state
)
Python and Ruby do not navigate, parse the returned fragment, or persist state. In the callback, atomically fetch and delete the stored state before adoption, even when validation fails. Reject a missing or previously consumed state.
google, github, microsoft, apple.
OAuth providers live in volcano-config.yaml under auth.providers.oauth (a list) and are applied with config deploy:
auth:
providers:
oauth:
- provider: google
enabled: true
client_id: "<client-id>"
client_secret: "<client-secret>"
redirect_url: "http://localhost:8000/auth/oauth/google/callback" # REQUIRED
# scopes: [openid, email, profile] # optional
redirect_url is required — omitting it fails config deploy with redirect_url is required. It is the Volcano callback (<apiUrl>/auth/oauth/<provider>/callback), not your app page: Volcano handles the provider round-trip, then returns your app to the URL from signInWithOAuth('<provider>', { redirectTo: '<app-url>' }) (the redirectTo option; defaults to the current page when omitted). Cloud form: https://api.<project>.volcano.dev/auth/oauth/<provider>/callback.auth.email_verification.require_confirmation: true and configure SMTP (Mailpit locally, real SMTP in cloud), or config deploy fails with email/password signups and SSO cannot both be enabled unless require_email_confirmation is true and SMTP is configured.volcano.auth.signInWithGoogle();
volcano.auth.signInWithGitHub();
volcano.auth.signInWithMicrosoft();
volcano.auth.signInWithApple();
// Generic form:
volcano.auth.signInWithOAuth('google');
// Return the browser to a specific app page afterward (defaults to the current page):
volcano.auth.signInWithOAuth('google', { redirectTo: `${window.location.origin}/dashboard` });
These redirect to the provider; on return, call volcano.initialize() on the callback page to consume the tokens from the URL.
const { data, error } = await volcano.auth.linkOAuthProvider('google');
if (data) window.location.href = data.authorization_url;
await volcano.auth.unlinkOAuthProvider('google');
const { providers, error } = await volcano.auth.getLinkedOAuthProviders();
const { data, error } = await volcano.auth.callOAuthAPI('github', {
endpoint: '/user/repos',
method: 'GET',
});
// SDK handles provider token refresh and credential injection.
Anonymous sign-in is off by default. For a project that accepts guests, configure both settings under auth.signup in volcano-config.yaml and deploy the config before calling the SDK. Hosting returns HTTP 403 if either setting is off.
# volcano-config.yaml
version: 1
auth:
signup:
enable_signup: true
enable_anonymous_signins: true
In JavaScript and TypeScript, use auth.signInAnonymously(). SDK 2.2.0 keeps signUpAnonymous() as a deprecated alias.
const { user, session, error } = await volcano.auth.signInAnonymously({
preferred_theme: 'dark', // optional metadata
});
To convert the guest to a full account, keep the same client session. The user ID and owned data are preserved.
const { user, error } = await volcano.auth.convertAnonymous({
email: '[email protected]',
password: 'secure-password-123',
metadata: { full_name: 'Alice' },
});
// After clicking the email link, the URL contains a token query param.
const token = new URLSearchParams(window.location.search).get('token');
const { error } = await volcano.auth.confirmEmail(token);
// Resend if the user lost the email
await volcano.auth.resendConfirmation('[email protected]');
// Always succeeds (even for unknown emails) for security.
await volcano.auth.forgotPassword('[email protected]');
// On the reset page:
const token = new URLSearchParams(window.location.search).get('token');
const { error } = await volcano.auth.resetPassword({
token,
newPassword: 'new-secure-password-456',
});
const { newEmail, error } = await volcano.auth.requestEmailChange('[email protected]');
// On the confirmation page:
const token = new URLSearchParams(window.location.search).get('token');
const { user, error } = await volcano.auth.confirmEmailChange(token);
// Cancel a pending change:
await volcano.auth.cancelEmailChange();
const { user, error } = await volcano.auth.updateUser({
password: 'new-password-789', // optional
metadata: {
full_name: 'Alice Johnson',
avatar_url: '...',
notification_preferences: { email: true, push: false },
},
});
// List sessions for the current user
const { sessions, total, error } = await volcano.auth.getSessions({ page: 1, limit: 20 });
// session fields: user_agent, ip_address, last_activity_at, is_current
// Revoke a specific session
await volcano.auth.deleteSession(sessionId);
// Revoke all OTHER sessions (keep current)
await volcano.auth.deleteAllOtherSessions();
sk-...) in anonKey in browser code; the SDK blocks it there. User-scoped server code uses the anon key with the caller's access token. Server code that needs the service key, such as a webhook route sending a durable message, passes it through anonKey and keeps it out of any code path that could leak (logs, error responses).signUp / updateUser. The SDK rejects weak passwords, but pre-validating gives better UX. The platform enforces a hard floor of 15 characters — a project can raise the minimum via min_password_length but cannot lower it below 15 (the validator uses max(15, configured)). Character-class rules (uppercase/number/special) are off by default and opt-in per project — the floor favors length over complexity. Use ≥15-char passwords in signup forms, tests, and seed data.onAuthStateChange(user => null) as a definitive sign-out signal: redirect to the login flow.| Message contains | Real example message | Meaning | Action |
|---|---|---|---|
already exists | user with this email already exists | Email taken on sign up | Prompt sign in |
password must | password must be at least 15 characters / password must contain at least one uppercase letter / ...one number / ...one special character (!@#$%^&*) | Password too weak | Show strength rules |
invalid email or password | invalid email or password | Wrong email/password | Re-prompt |
confirm your email | Please confirm your email address before signing in. (sign-in gate) or email confirmation required - please check your email for confirmation link (signup) | Verification pending | Show resend UI |
rate limit | rate limit exceeded, try again later | Rate-limited | Back off and inform user |
No active session | No active session | User not logged in | Send to login |
Session expired | Session expired | Refresh failed | Force sign in |
volcano.initialize()) is wired at app startup.onAuthStateChange listener has a paired unsubscribe() on teardown.convertAnonymous is used (not delete + signUp) so user IDs are preserved.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub kong/volcano-agentic-plugins --plugin volcano18 skills in this plugin
/install-volcanoInstall, upgrade, or set up the Volcano CLI. Use this whenever a task needs the volcano CLI and `which volcano` hasn't been confirmed yet, even if the user never says "install" (e.g. "build me a todo API using volcano")./volcano-databaseUse whenever a Volcano app stores or persists data, including CRUD, records, per-user data, migrations, RLS, todos, chat messages, polls, analytics, counters, click tracking, CMS content, feature flags, and leaderboards./volcano-durableUse for Volcano durable functions, long-running or resumable workflows, checkpointed steps, waits, human approvals, messages sent to a running workflow, callbacks an external system answers with a token, live workflow progress, polling, durable executions, idempotent starts, and durable function schedulers.Other plugins' skills for the same job