Isomorphic Javascript client for Supabase
npm install memfirebase-wechatsupabase-jssh
npm install @supabase/supabase-js
`
Then you're able to import the library and establish the connection with the database:
`js
import { createClient } from '@supabase/supabase-js'
// Create a single supabase client for interacting with your database
const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key')
`
$3
You can now use plain
or even:
`html
`
Then you can use it from a global supabase variable:
`html
`
$3
You can now use type="module"
$3
supabase-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:
`js
import { createClient } from '@supabase/supabase-js'
// Provide a custom fetch implementation as an option
const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key', {
global: {
fetch: (...args) => fetch(...args),
},
})
``