This package allows you to easily integrate Forest Admin in your Nuxt 3 application.
# npm
npm install nuxt-forestadmin
# yarn
yarn add nuxt-forestadmin
# pnpm
pnpm add nuxt-forestadmin
You also need to install at least one of the Forest Admin data source packages.
Add the module in nuxt.config.ts and specify the datasource:
// Replace with a different datasource if needed
import { createSqlDataSource } from '@forestadmin/datasource-sql'
export default defineNuxtConfig({
modules: [
'nuxt-forestadmin'
],
forestadmin: {
dataSource: {
factory: createSqlDataSource("<DATABASE URL>")
}
}
})
̀ ``
Specify the authSecret and envSecret that you obtained during the onboarding procedure. You have two options to set them:
Via the Runtime Config inside nuxt.config.ts:
runtimeConfig: {
forestadmin: {
authSecret: "...",
envSecret: "..."
}
}
̀ ``
These can then be overwritten by the environment variables `NUXT_FORESTADMIN_AUTHSECRET` and `NUXT_FORESTADMIN_ENVSECRET` at runtime.
Via the forestadmin key inside the nuxt.config.ts at build-time:
forestadmin: {
authSecret: "...",
envSecret: "..."
}
TODO
That’s it! You can now use Forest Admin in your Nuxt app ✨
corepack enable (use npm i -g corepack for Node.js < 16.10).pnpm install.pnpm run prepare to generate type stubs.pnpm run dev to start playground in development mode.Made with 💛
Published under MIT License.