
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@supabase/gotrue-js
Advanced tools
@supabase/gotrue-js is a JavaScript client library for Supabase's GoTrue server, which provides user authentication and management functionalities. It allows developers to handle user sign-ups, logins, password recovery, and other authentication-related tasks.
User Sign-Up
This feature allows you to sign up a new user with an email and password. The code sample demonstrates how to initialize the GoTrueClient and use the signUp method to create a new user.
const { GoTrueClient } = require('@supabase/gotrue-js');
const auth = new GoTrueClient({
url: 'https://your-supabase-url.supabase.co/auth/v1',
headers: { 'apikey': 'your-api-key' }
});
async function signUp(email, password) {
const { user, error } = await auth.signUp({ email, password });
if (error) console.error('Error signing up:', error);
else console.log('User signed up:', user);
}
signUp('user@example.com', 'password123');
User Login
This feature allows you to log in an existing user with an email and password. The code sample demonstrates how to use the signIn method to authenticate a user.
const { GoTrueClient } = require('@supabase/gotrue-js');
const auth = new GoTrueClient({
url: 'https://your-supabase-url.supabase.co/auth/v1',
headers: { 'apikey': 'your-api-key' }
});
async function login(email, password) {
const { user, error } = await auth.signIn({ email, password });
if (error) console.error('Error logging in:', error);
else console.log('User logged in:', user);
}
login('user@example.com', 'password123');
Password Recovery
This feature allows you to send a password recovery email to a user. The code sample demonstrates how to use the resetPasswordForEmail method to initiate the password recovery process.
const { GoTrueClient } = require('@supabase/gotrue-js');
const auth = new GoTrueClient({
url: 'https://your-supabase-url.supabase.co/auth/v1',
headers: { 'apikey': 'your-api-key' }
});
async function recoverPassword(email) {
const { data, error } = await auth.api.resetPasswordForEmail(email);
if (error) console.error('Error sending password recovery email:', error);
else console.log('Password recovery email sent:', data);
}
recoverPassword('user@example.com');
Firebase is a comprehensive app development platform that includes authentication services similar to @supabase/gotrue-js. It provides a wide range of authentication methods, including email/password, phone, and social providers. Firebase also offers additional services like real-time databases, cloud storage, and hosting.
Auth0 is a flexible, drop-in solution to add authentication and authorization services to your applications. The auth0-js library provides similar functionalities to @supabase/gotrue-js, such as user sign-up, login, and password recovery. Auth0 also supports a wide range of identity providers and offers advanced features like multi-factor authentication and user management.
AWS Amplify is a set of tools and services for building secure, scalable mobile and web applications. The Amplify Auth module provides authentication functionalities similar to @supabase/gotrue-js, including user sign-up, login, and password recovery. It integrates seamlessly with other AWS services and supports various authentication methods.
auth-js
An isomorphic JavaScript client library for the Supabase Auth API.
auth-js
: https://supabase.com/docs/reference/javascript/auth-signupInstall
npm install --save @supabase/auth-js
Usage
import { AuthClient } from '@supabase/auth-js'
const GOTRUE_URL = 'http://localhost:9999'
const auth = new AuthClient({ url: GOTRUE_URL })
signUp()
: https://supabase.io/docs/reference/javascript/auth-signupsignIn()
: https://supabase.io/docs/reference/javascript/auth-signinsignOut()
: https://supabase.io/docs/reference/javascript/auth-signoutfetch
implementationauth-js
uses the cross-fetch
library to make HTTP requests, but an alternative fetch
implementation can be provided as an option. This is most useful in environments where cross-fetch
is not compatible, for instance Cloudflare Workers:
import { AuthClient } from '@supabase/auth-js'
const AUTH_URL = 'http://localhost:9999'
const auth = new AuthClient({ url: AUTH_URL, fetch: fetch })
We are building the features of Firebase using enterprise-grade, open source products. We support existing communities wherever possible, and if the products don’t exist we build them and open source them ourselves.
FAQs
Official client library for Supabase Auth
The npm package @supabase/gotrue-js receives a total of 119,060 weekly downloads. As such, @supabase/gotrue-js popularity was classified as popular.
We found that @supabase/gotrue-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 13 open source maintainers 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
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.