
Security News
White House Authorizes Private Companies to Conduct Offensive Cyber Operations
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.
@authon/svelte
Advanced tools
Svelte SDK for Authon — stores, actions, and components.
npm install @authon/svelte
# or
pnpm add @authon/svelte
Requires svelte >= 4.0.0.
// src/lib/authon.ts
import { initAuthon } from '@authon/svelte';
export const authon = initAuthon({
publishableKey: 'pk_live_...',
});
<script>
import { user, isSignedIn, isLoading } from '@authon/svelte';
import { openSignIn, signOut } from '@authon/svelte';
</script>
{#if $isLoading}
<p>Loading...</p>
{:else if $isSignedIn}
<p>Welcome, {$user?.displayName}</p>
<button on:click={signOut}>Sign Out</button>
{:else}
<button on:click={openSignIn}>Sign In</button>
{/if}
<script>
import { SignedIn, SignedOut, UserButton } from '@authon/svelte';
</script>
<SignedIn>
<UserButton />
</SignedIn>
<SignedOut>
<button on:click={openSignIn}>Sign In</button>
</SignedOut>
| Store | Type | Description |
|---|---|---|
user | Readable<AuthonUser | null> | Current user |
isSignedIn | Readable<boolean> | Whether the user is signed in |
isLoading | Readable<boolean> | Whether auth state is loading |
| Function | Returns | Description |
|---|---|---|
openSignIn() | Promise<void> | Open sign-in modal |
openSignUp() | Promise<void> | Open sign-up modal |
signOut() | Promise<void> | Sign out |
getToken() | string | null | Get current access token |
| Component | Description |
|---|---|
<SignedIn> | Renders slot only when signed in |
<SignedOut> | Renders slot only when signed out |
<UserButton> | Avatar dropdown with sign-out |
FAQs
Authon Svelte SDK — stores and components
The npm package @authon/svelte receives a total of 31 weekly downloads. As such, @authon/svelte popularity was classified as not popular.
We found that @authon/svelte 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.

Security News
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.

Research
/Security News
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.