Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@supabase/supabase-js

Package Overview
Dependencies
Maintainers
9
Versions
339
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@supabase/supabase-js

Isomorphic Javascript client for Supabase

  • 2.42.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
488K
increased by3.2%
Maintainers
9
Weekly downloads
 
Created

What is @supabase/supabase-js?

@supabase/supabase-js is a JavaScript client library for interacting with Supabase, an open-source Firebase alternative. It allows developers to perform a variety of database operations, authentication, and real-time subscriptions with ease.

What are @supabase/supabase-js's main functionalities?

Database Operations

This feature allows you to perform CRUD operations on your database. The code sample demonstrates how to fetch data from a table using the Supabase client.

const { createClient } = require('@supabase/supabase-js');
const supabase = createClient('https://your-project.supabase.co', 'public-anon-key');

async function fetchData() {
  let { data, error } = await supabase
    .from('your_table')
    .select('*');
  if (error) console.error(error);
  else console.log(data);
}
fetchData();

Authentication

This feature allows you to manage user authentication, including sign-up, sign-in, and sign-out. The code sample demonstrates how to sign up a new user.

const { createClient } = require('@supabase/supabase-js');
const supabase = createClient('https://your-project.supabase.co', 'public-anon-key');

async function signUp() {
  let { user, error } = await supabase.auth.signUp({
    email: 'example@example.com',
    password: 'example-password'
  });
  if (error) console.error(error);
  else console.log(user);
}
signUp();

Real-time Subscriptions

This feature allows you to subscribe to real-time changes in your database. The code sample demonstrates how to listen for new rows being inserted into a table.

const { createClient } = require('@supabase/supabase-js');
const supabase = createClient('https://your-project.supabase.co', 'public-anon-key');

supabase
  .from('your_table')
  .on('INSERT', payload => {
    console.log('New row added!', payload);
  })
  .subscribe();

Other packages similar to @supabase/supabase-js

Keywords

FAQs

Package last updated on 12 Apr 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc