diff --git a/README.md b/README.md
index 0c4787f7228..f45db3d4a06 100644
--- a/README.md
+++ b/README.md
@@ -66,12 +66,12 @@ Our client library is modular. Each sub-library is a standalone implementation f
- `realtime-{lang}`: Client library to work with [Realtime](https://github.com/supabase/realtime)
- `gotrue-{lang}`: Client library to work with [GoTrue](https://github.com/netlify/gotrue)
-| Repo | Official | Community |
-| --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| **`supabase-{lang}`** | [`JS`](https://github.com/supabase/supabase-js) | [`C#`](https://github.com/supabase/supabase-csharp) \| [`Dart`](https://github.com/supabase/supabase-dart) \| [`Python`](https://github.com/supabase/supabase-py) \| `Rust` \| [`Ruby`](https://github.com/supabase/supabase-rb)
-| `postgrest-{lang}` | [`JS`](https://github.com/supabase/postgrest-js) | [`C#`](https://github.com/supabase/postgrest-csharp) \| [`Dart`](https://github.com/supabase/postgrest-dart) \| [`Python`](https://github.com/supabase/postgrest-py) \| [`Rust`](https://github.com/supabase/postgrest-rs) \| [`Ruby`](https://github.com/supabase/postgrest-rb)
-| `realtime-{lang}` | [`JS`](https://github.com/supabase/realtime-js) | [`C#`](https://github.com/supabase/realtime-csharp) \| [`Dart`](https://github.com/supabase/realtime-dart) \| [`Python`](https://github.com/supabase/realtime-py) \| `Rust` \| `Ruby` |
-| `gotrue-{lang}` | [`JS`](https://github.com/supabase/gotrue-js) | [`C#`](https://github.com/supabase/gotrue-csharp) \| [`Dart`](https://github.com/supabase/gotrue-dart) \| [`Python`](https://github.com/supabase/gotrue-py) \| `Rust` \| `Ruby` |
+| Repo | Official | Community |
+| --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **`supabase-{lang}`** | [`JS`](https://github.com/supabase/supabase-js) | [`C#`](https://github.com/supabase/supabase-csharp) \| [`Dart`](https://github.com/supabase/supabase-dart) \| [`Python`](https://github.com/supabase/supabase-py) \| `Rust` \| [`Ruby`](https://github.com/supabase/supabase-rb) |
+| `postgrest-{lang}` | [`JS`](https://github.com/supabase/postgrest-js) | [`C#`](https://github.com/supabase/postgrest-csharp) \| [`Dart`](https://github.com/supabase/postgrest-dart) \| [`Python`](https://github.com/supabase/postgrest-py) \| [`Rust`](https://github.com/supabase/postgrest-rs) \| [`Ruby`](https://github.com/supabase/postgrest-rb) |
+| `realtime-{lang}` | [`JS`](https://github.com/supabase/realtime-js) | [`C#`](https://github.com/supabase/realtime-csharp) \| [`Dart`](https://github.com/supabase/realtime-dart) \| [`Python`](https://github.com/supabase/realtime-py) \| `Rust` \| `Ruby` |
+| `gotrue-{lang}` | [`JS`](https://github.com/supabase/gotrue-js) | [`C#`](https://github.com/supabase/gotrue-csharp) \| [`Dart`](https://github.com/supabase/gotrue-dart) \| [`Python`](https://github.com/supabase/gotrue-py) \| `Rust` \| `Ruby` |
diff --git a/SECURITY.md b/SECURITY.md
index f382301feaa..63dc5033611 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -2,24 +2,22 @@
## Supported Versions
-
| Version | Supported |
| ------- | ------------------ |
-| All | :white_check_mark: |
+| All | :white_check_mark: |
## Reporting a Vulnerability
Contact: security@supabase.io
Canonical: https://supabase.io/.well-known/security.txt
-
At Supabase, we consider the security of our systems a top priority. But no matter how much effort we put into system security, there can still be vulnerabilities present.
If you discover a vulnerability, we would like to know about it so we can take steps to address it as quickly as possible. We would like to ask you to help us better protect our clients and our systems.
Please do the following:
-- E-mail your findings to security@supabase.io.
+- E-mail your findings to security@supabase.io.
- Do not take advantage of the vulnerability or problem you have discovered, for example by downloading more data than necessary to demonstrate the vulnerability or deleting or modifying other people's data,
- Do not reveal the problem to others until it has been resolved,
- Do not use attacks on physical security, social engineering, distributed denial of service, spam or applications of third parties, and
diff --git a/examples/expo-todo-list/app.json b/examples/expo-todo-list/app.json
index 9e95ce8842a..7190ea70c37 100644
--- a/examples/expo-todo-list/app.json
+++ b/examples/expo-todo-list/app.json
@@ -13,9 +13,7 @@
"updates": {
"fallbackToCacheTimeout": 0
},
- "assetBundlePatterns": [
- "**/*"
- ],
+ "assetBundlePatterns": ["**/*"],
"ios": {
"supportsTablet": true
},
diff --git a/examples/expo-todo-list/babel.config.js b/examples/expo-todo-list/babel.config.js
index c4bdcb5009d..f27e6b0123c 100644
--- a/examples/expo-todo-list/babel.config.js
+++ b/examples/expo-todo-list/babel.config.js
@@ -1,7 +1,7 @@
-module.exports = function(api) {
- api.cache(true);
+module.exports = function (api) {
+ api.cache(true)
return {
presets: ['babel-preset-expo'],
plugins: ['inline-dotenv'],
}
-};
+}
diff --git a/examples/javascript-auth/README.md b/examples/javascript-auth/README.md
index b5df09fa272..3289afecbf8 100644
--- a/examples/javascript-auth/README.md
+++ b/examples/javascript-auth/README.md
@@ -7,9 +7,8 @@ How to sign up and login using supabase and supabase-js using HTML and JavaScrip
### running
+
`npm run dev` (requires npx to be installed)
if you want to make changes without restarting the server run this in a different terminal window:
`npm run watch`
-
-
diff --git a/examples/nextjs-live-tracker-map/components/MapInput.js b/examples/nextjs-live-tracker-map/components/MapInput.js
index ad2641e2dd9..1d9046adf0e 100644
--- a/examples/nextjs-live-tracker-map/components/MapInput.js
+++ b/examples/nextjs-live-tracker-map/components/MapInput.js
@@ -1,77 +1,63 @@
-import { useEffect, useState, useRef, useMemo, useCallback } from "react";
-import { MapContainer, TileLayer, Marker, Popup, Circle } from "react-leaflet";
-import { RoundToFixDecimals } from "lib/utils";
-import { supabase } from "lib/api";
-import TextLog from "components/TextLog";
+import { useEffect, useState, useRef, useMemo, useCallback } from 'react'
+import { MapContainer, TileLayer, Marker, Popup, Circle } from 'react-leaflet'
+import { RoundToFixDecimals } from 'lib/utils'
+import { supabase } from 'lib/api'
+import TextLog from 'components/TextLog'
function DraggableMarker({ initialPos, addCircle }) {
- const [position, setPosition] = useState(initialPos);
- const markerRef = useRef(null);
+ const [position, setPosition] = useState(initialPos)
+ const markerRef = useRef(null)
const eventHandlers = useMemo(
() => ({
dragend() {
- const marker = markerRef.current;
- const pos = marker.getLatLng();
- if (addCircle) addCircle(pos);
- if (marker) setPosition(pos);
+ const marker = markerRef.current
+ const pos = marker.getLatLng()
+ if (addCircle) addCircle(pos)
+ if (marker) setPosition(pos)
},
}),
[addCircle]
- );
+ )
return (
-
+
{`lat: ${position.lat}`}
{`long: ${position.lng}`}
- );
+ )
}
function MapInput({ clientRef, center, zoom }) {
- const [log, setLog] = useState(undefined);
- const [circles, setCircles] = useState([]);
+ const [log, setLog] = useState(undefined)
+ const [circles, setCircles] = useState([])
useEffect(() => {
- let newLog = `Ref: ${clientRef}\nReady to send location...`;
+ let newLog = `Ref: ${clientRef}\nReady to send location...`
newLog += circles.map((item) => {
- return `\nsent lat=${RoundToFixDecimals(
- item.lat
- )} long=${RoundToFixDecimals(item.lng)}`;
- });
- setLog(newLog);
- }, [circles, clientRef]);
+ return `\nsent lat=${RoundToFixDecimals(item.lat)} long=${RoundToFixDecimals(item.lng)}`
+ })
+ setLog(newLog)
+ }, [circles, clientRef])
const onAddCircle = useCallback(
async (pos) => {
- setCircles([...circles, pos]);
+ setCircles([...circles, pos])
// insert new location
await supabase
- .from("locations")
- .insert([
- { latitude: pos.lat, longitude: pos.lng, user_id: clientRef },
- ]);
+ .from('locations')
+ .insert([{ latitude: pos.lat, longitude: pos.lng, user_id: clientRef }])
},
[setCircles, circles, supabase, clientRef]
- );
+ )
function renderCircles() {
return circles.map((item, index) => (
-
- ));
+
+ ))
}
return (
@@ -96,6 +82,6 @@ function MapInput({ clientRef, center, zoom }) {
}
`}
- );
+ )
}
-export default MapInput;
+export default MapInput
diff --git a/examples/nextjs-live-tracker-map/components/MapView.js b/examples/nextjs-live-tracker-map/components/MapView.js
index 6e44f4994ff..0b332b16393 100644
--- a/examples/nextjs-live-tracker-map/components/MapView.js
+++ b/examples/nextjs-live-tracker-map/components/MapView.js
@@ -1,49 +1,43 @@
-import { useEffect, useReducer } from "react";
-import { MapContainer, TileLayer, Polyline } from "react-leaflet";
-import { RoundToFixDecimals } from "lib/utils";
-import { supabase } from "lib/api";
-import TextLog from "components/TextLog";
+import { useEffect, useReducer } from 'react'
+import { MapContainer, TileLayer, Polyline } from 'react-leaflet'
+import { RoundToFixDecimals } from 'lib/utils'
+import { supabase } from 'lib/api'
+import TextLog from 'components/TextLog'
export default function MapView({ center, zoom }) {
- const [state, dispatch] = useReducer(mapReducer, initialState);
+ const [state, dispatch] = useReducer(mapReducer, initialState)
useEffect(() => {
// Listen to INSERT event on locations table
const subscription = supabase
- .from("locations")
- .on("INSERT", (payload) => {
- console.log("New Position received!", payload);
- dispatch({ payload: payload.new });
+ .from('locations')
+ .on('INSERT', (payload) => {
+ console.log('New Position received!', payload)
+ dispatch({ payload: payload.new })
})
- .subscribe();
+ .subscribe()
return () => {
- if (subscription) supabase.removeSubscription(subscription);
- };
- }, []);
+ if (subscription) supabase.removeSubscription(subscription)
+ }
+ }, [])
function drawPolylines() {
let result = Object.keys(state.userPositions).map((key, idx) => {
- const item = state.userPositions[key];
- if (!item) return;
+ const item = state.userPositions[key]
+ if (!item) return
- const { color, data } = item;
+ const { color, data } = item
const polyline = data.map((item) => {
- if (!item) return;
- const { lat, lng } = item;
- return [lat, lng];
- });
+ if (!item) return
+ const { lat, lng } = item
+ return [lat, lng]
+ })
- return (
-
- );
- });
+ return
+ })
- return result;
+ return result
}
return (
@@ -57,35 +51,35 @@ export default function MapView({ center, zoom }) {
- );
+ )
}
function randomColor() {
- var array = ["black", "magenta", "blue", "indigo", "green", "blueviolet"];
- return array[Math.floor(Math.random() * array.length)];
+ var array = ['black', 'magenta', 'blue', 'indigo', 'green', 'blueviolet']
+ return array[Math.floor(Math.random() * array.length)]
}
const initialState = {
- log: "Start listerning...",
+ log: 'Start listerning...',
userPositions: {},
-};
+}
const mapReducer = (state, action) => {
- const { id, user_id, latitude: lat, longitude: lng } = action.payload;
- const position = { id, user_id, lat, lng };
+ const { id, user_id, latitude: lat, longitude: lng } = action.payload
+ const position = { id, user_id, lat, lng }
- let positions = state.userPositions[user_id];
- if (positions) positions.data = [...positions.data, position];
- else positions = { color: randomColor(), data: [position] };
- const userPositions = { ...state.userPositions, [user_id]: positions };
+ let positions = state.userPositions[user_id]
+ if (positions) positions.data = [...positions.data, position]
+ else positions = { color: randomColor(), data: [position] }
+ const userPositions = { ...state.userPositions, [user_id]: positions }
- let log = state.log;
- log += `\nuser_id=${user_id}`;
- log += ` lat=${RoundToFixDecimals(lat)}`;
- log += ` long=${RoundToFixDecimals(lng)}`;
+ let log = state.log
+ log += `\nuser_id=${user_id}`
+ log += ` lat=${RoundToFixDecimals(lat)}`
+ log += ` long=${RoundToFixDecimals(lng)}`
return {
log,
userPositions,
- };
-};
+ }
+}
diff --git a/examples/nextjs-live-tracker-map/components/PageLayout.js b/examples/nextjs-live-tracker-map/components/PageLayout.js
index 66fec554c5e..3020edae584 100644
--- a/examples/nextjs-live-tracker-map/components/PageLayout.js
+++ b/examples/nextjs-live-tracker-map/components/PageLayout.js
@@ -1,4 +1,4 @@
-import Head from "next/head";
+import Head from 'next/head'
export default function PageLayout({ title, children }) {
return (
@@ -10,10 +10,9 @@ export default function PageLayout({ title, children }) {
- );
+ )
}
diff --git a/examples/nextjs-live-tracker-map/components/SignIn.js b/examples/nextjs-live-tracker-map/components/SignIn.js
index cb2b11f9394..ab97f36de3e 100644
--- a/examples/nextjs-live-tracker-map/components/SignIn.js
+++ b/examples/nextjs-live-tracker-map/components/SignIn.js
@@ -1,14 +1,14 @@
-import React, { useState } from "react";
-import { supabase } from "lib/api";
+import React, { useState } from 'react'
+import { supabase } from 'lib/api'
/**
* Sign in with username and password
*
* @param {String} role DRIVER/MANAGER. default as DRIVER
*/
-export default function SignIn({ role = "DRIVER" }) {
- const [formData, updateFormData] = useState({ role });
- const [action, setAction] = useState(null);
+export default function SignIn({ role = 'DRIVER' }) {
+ const [formData, updateFormData] = useState({ role })
+ const [action, setAction] = useState(null)
function onChange(e) {
updateFormData({
@@ -16,37 +16,37 @@ export default function SignIn({ role = "DRIVER" }) {
// Trimming any whitespace
[e.target.name]: e.target.value.trim(),
- });
+ })
}
async function updateUserRole(user) {
- if (!user || user.user_metadata?.role) return;
+ if (!user || user.user_metadata?.role) return
// update user role
await supabase.auth.update({
data: { role },
- });
+ })
}
async function onSubmit(event) {
- event.preventDefault();
+ event.preventDefault()
try {
- if (action === "SIGNUP") {
- const { email, password, role } = formData;
- const { error, user } = await supabase.auth.signUp({ email, password });
- if (error) throw error;
+ if (action === 'SIGNUP') {
+ const { email, password, role } = formData
+ const { error, user } = await supabase.auth.signUp({ email, password })
+ if (error) throw error
// update user role
await supabase.auth.update({
data: { role },
- });
- } else if (action === "LOGIN") {
- const { error } = await supabase.auth.signIn(formData);
- if (error) throw error;
+ })
+ } else if (action === 'LOGIN') {
+ const { error } = await supabase.auth.signIn(formData)
+ if (error) throw error
}
} catch (error) {
- alert(error.message);
+ alert(error.message)
}
}
@@ -60,10 +60,10 @@ export default function SignIn({ role = "DRIVER" }) {
Password
-