Skip to content

Commit be79c88

Browse files
authored
chore: adds UMD instructions to README
1 parent e122704 commit be79c88

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,24 @@ import { createClient } from '@supabase/supabase-js'
1717
const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key')
1818
```
1919

20+
### UMD
21+
22+
You can now use plain `<script>`s to import supabase-js from CDNs, like
23+
24+
`<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js"></script>`
25+
or
26+
`<script src="https://unpkg.com/@supabase/supabase-js"></script>`.
27+
28+
Then you can use it from a global `supabase` variable:
29+
30+
```html
31+
<script>
32+
const { createClient } = supabase
33+
supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key')
34+
...
35+
</script>
36+
```
37+
2038
## Sponsors
2139

2240
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. Thanks to these sponsors who are making the OSS ecosystem better for everyone.

0 commit comments

Comments
 (0)