Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SUPERBASE_URL=
SUPERBASE_KEY=
34 changes: 29 additions & 5 deletions template-typescript-bottom-tabs-supabase-auth-flow/.gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,37 @@
node_modules/**/*
.expo/*
npm-debug.*
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

# dependencies
node_modules/

# Expo
.expo/
dist/
web-build/

# Native
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*
web-build/

# Metro
.metro-health-check*

# debug
npm-debug.*
yarn-debug.*
yarn-error.*

# macOS
.DS_Store
*.pem

# local env files
.env*.local

# typescript
*.tsbuildinfo

.env
21 changes: 13 additions & 8 deletions template-typescript-bottom-tabs-supabase-auth-flow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,19 @@ Typescript Template starter with React Navigation Bottom Tabs and Supabase auth
### Supabase Setup

- Set up a new Supabase.io project
- Fill your supabase credentials to your config inside `./src/initSupabase.ts`
- Copy .env.example to .env
- Fill your supabase credentials to your .env file inside (`SUPERBASE_URL` and `SUPERBASE_KEY`)
- You can find your supabase credentials in your project -> settings -> API

```jsx
// Better put your these secret keys in .env file
export const supabase = createClient(
"supabaseUrl", "supabaseKey",
{
localStorage: AsyncStorage as any,
}
);
export const supabase = createClient(superbaseUrl, superbaseKey, {
auth: {
storage: AsyncStorage,
autoRefreshToken: true,
persistSession: true,
detectSessionInUrl: false,
},
});
```

and you good to go!
Expand Down Expand Up @@ -104,3 +106,6 @@ These are the folders and the functionality all in `src/`
if you find these useful don't forget to give it a star ⭐ and share it to your friends ❤️

Reach me on [twitter](https://twitter.com/kikiding/)

# Notes
1. When .env file is updated, the `env.d.ts` needs to be updated accordingly. This is done to avoid TypeScript complaining about type error.
3 changes: 2 additions & 1 deletion template-typescript-bottom-tabs-supabase-auth-flow/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
Expand All @@ -22,7 +23,7 @@
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#FFFFFF"
"backgroundColor": "#ffffff"
}
},
"web": {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
module.exports = function(api) {
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
plugins: [
[
"module:react-native-dotenv",
{
envName: "APP_ENV",
moduleName: "@env",
path: ".env"
}
]
]
};
};
4 changes: 4 additions & 0 deletions template-typescript-bottom-tabs-supabase-auth-flow/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module '@env' {
export const SUPERBASE_URL: string;
export const SUPERBASE_KEY: string;
}
Loading