
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
nest-supabase-guard
Advanced tools
Authentication Guard for NestJS using Supabase. When applied to a route, checks that an auth bearer JWT is in the request headers, checks that the token was created by your Supabase instance, gets the User information from Supabase's database and adds the Supabase User object to the request for further actions.
npm i nest-supabase-guard
Import and use the Guard like you would any other.
On individual routes:
import { SupabaseAuthGuard } from "nest-supabase-guard";
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
@UseGuards(SupabaseAuthGuard)
@Get()
getHello(): string {
return this.appService.getHello();
}
}
The Guard will take the resulting Supabase User of a successfully authenticated request and add it to the request object, as request.authUser, for later use.
SUPABASE_URL=yourSupabaseUrl
SUPABASE_ANON_KEY=yourSupabaseAnonKey
Routes protected by this guard should expect the request to have an authentication header with a bearer token, where the bearer token is the supabase-generated token for the requesting user.
For example, your frontend might make a request that looks something like:
const session = await supabase.auth.getSession();
axios.get("https://yourbackend.com/your-endpoint", {
headers: {
Authorization: `Bearer ${session.data.session.access_token}`,
},
});
By default, the Guard will create an instance of a Supabase client behind the scenes. If you are already using a Supabase client and want to avoid having more than one, you can have the guard use yours.
Pass your Supabase client into the customSupabaseClientProvider(supabaseClient) helper, and add the result to your list of providers:
import { customSupabaseClientProvider } from "nest-supabase-guard";
const supabaseClient = createClient(
process.env.SUPABASE_URL,
process.env.SUPABASE_ANON_KEY
);
@Module({
imports: [],
controllers: [AppController],
providers: [AppService, customSupabaseClientProvider(supabaseClient)],
})
export class AppModule {}
FAQs
Auth guard for NestJS using supabase
The npm package nest-supabase-guard receives a total of 5 weekly downloads. As such, nest-supabase-guard popularity was classified as not popular.
We found that nest-supabase-guard demonstrated a not healthy version release cadence and project activity because the last version was released 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
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.