nuxt-supabase
A supa simple Nuxt Module for Supabase
2,128
170
| Install | |
|---|---|
npm install nuxt-supabase |
|
| Latest Version: | 2.3.1 |
| Vue: | 2 |
| License: | MIT |
| Last Updated: | Mar 16, 2023 |
| Links: | GitHub · npm |
Maintainer: scottymeuk
Nuxt + Supabase
A supa simple wrapper around Supabase.js to enable usage within Nuxt.
This package uses vue-supabase.
Install
yarn add nuxt-supabase
Configure
Add the following to your nuxt.config.js file.
modules: [
['nuxt-supabase', {
supabaseUrl: 'YOUR_SUPABASE_URL',
supabaseKey: 'YOUR_SUPABASE_KEY'
}]
],
TypeScript
Add the package to your tsconfig.json to make typescript aware of the additional types to the the nuxt context
{
"compilerOptions": {
"types": [
"@nuxt/types",
"nuxt-supabase"
]
}
}
Usage
You can then use supabase within your Nuxt context, or Vue components.
<script>
export default {
async asyncData({ $supabase }) {
return {
events: await $supabase.from("events").select("*");
}
}
}
</script>
<script>
export default {
data() {
return {
events: null,
};
},
methods: {
async getEvents() {
this.events = await this.$supabase.from("events").select("*");
},
},
};
</script>
Related Packages
nuxt-define
One utility function for module authors to define compiler constants for all bui...
13,412,511
Version History
| Version | Released | License |
|---|---|---|
| 2.3.1 | MIT | |
| 2.3.0 | MIT | |
| 2.2.1 | MIT | |
| 2.2.0 | MIT | |
| 2.1.0 | MIT | |
| 2.0.0 | MIT | |
| 1.0.8 | MIT | |
| 1.0.7 | MIT | |
| 1.0.6 | MIT | |
| 1.0.5 | MIT | |
| 1.0.4 | MIT | |
| 1.0.3 | MIT | |
| 1.0.2 | MIT | |
| 1.0.1 | MIT | |
| 1.0.0 | MIT |
Pre-releases (1)
| Version | Released | License |
|---|---|---|
| 1.0.6-pre.1 | MIT |