
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
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
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.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.