# laravel/sanctum

Laravel Sanctum provides a featherweight authentication system for SPAs and simple APIs.

Repository: https://github.com/laravel/sanctum
Canonical: https://ross.abutalabs.com/products/sanctum
Homepage: https://laravel.com/docs/sanctum
Language: PHP
License: MIT
License Family: permissive
Topics: laravel, sanctum, auth
Last push: 2026-08-04T08:16:31+00:00

## Health v2 (maintenance only)
Score: 96/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 96, release rhythm 94, longevity 100
- inputs: {"age_days": 2429, "days_push": 29, "days_rel": 43, "gap_med": 14, "n_releases_24m": 18}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2977, forks 329 (observed 2026-08-28T04:07:33.013912+00:00)

## What it is
Laravel Sanctum is a featherweight authentication package for Laravel that issues API tokens and authenticates single-page applications, mobile apps, and simple token-based APIs. It stores tokens in a single database table with optional abilities/scopes, avoiding the complexity of OAuth.

## Use cases
- issue personal access tokens for a Laravel API
- authenticate a Vue or React SPA against a Laravel backend
- add token-based auth to a mobile app without OAuth
- grant scoped abilities to API tokens
- authenticate users with session cookies for same-domain SPAs
- revoke or expire API tokens per user

## When to choose
- you have a Laravel backend serving an SPA, mobile app, or simple API
- you want lightweight token auth without OAuth complexity
- you need per-token abilities/scopes and easy revocation

## When to avoid
- you need full OAuth2 flows (use Laravel Passport instead)
- your project is not built on Laravel/PHP
- you need federated identity like SAML or OIDC

## Facets
- artifact type: library
- maturity: stable
- function: auth, middleware, api-framework
- domain: web-development, backend, security, apis
- platform: php
- tags: api-tokens, spa-authentication, personal-access-tokens, token-scopes, mobile-authentication, laravel-ecosystem, laravel, web-server

## Member repositories
- laravel/sanctum (main) score 96

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:33.013912+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:31:33.536571+00:00, confidence not recorded.
  - readme: https://github.com/laravel/sanctum (fetched 2026-08-28T04:07:33.013912+00:00, sha 2febd3366ab2)
  - homepage: https://laravel.com/docs/sanctum (fetched 2026-08-29T09:46:50.934763+00:00, sha 4933d2bbdec4)
  - site_page: https://laravel.com/framework/docs/releases (fetched 2026-08-29T09:46:50.937819+00:00, sha 5c016fc7c447)
  - site_page: https://laravel.com/framework/docs/upgrade (fetched 2026-08-29T09:46:50.939853+00:00, sha ab7e04529370)
  - site_page: https://laravel.com/framework/docs/contributions (fetched 2026-08-29T09:46:50.943310+00:00, sha 055cecf89580)
  - site_page: https://laravel.com/framework/docs/installation (fetched 2026-08-29T09:46:50.946865+00:00, sha 07f03770b063)
  - site_page: https://laravel.com/framework/docs/configuration (fetched 2026-08-29T09:46:50.949410+00:00, sha c92529598f75)
  - site_page: https://laravel.com/framework/docs/ai (fetched 2026-08-29T09:46:50.951484+00:00, sha e6f260f0ed87)
  - site_page: https://laravel.com/framework/docs/structure (fetched 2026-08-29T09:46:50.953207+00:00, sha ee79808881f8)
  - site_page: https://laravel.com/framework/docs/frontend (fetched 2026-08-29T09:46:50.954957+00:00, sha 2bbbf553c4eb)
- Data as of 2026-08-30T08:39:29.467469+00:00.
