Guides
Nuxt + Turso
Set up Turso in your Nuxt project in minutes
Before you start, make sure you:
- Install the Turso CLI
- Sign up or login to Turso
- Have a Nuxt app — learn more
1
Install the libSQL SDK
Begin by installing the @libsql/client
dependency in your project:
2
Configure database credentials
Get the database URL:
Get the database authentication token:
Assign credentials to the environment variables inside .env
.
3
Configure variables inside Nuxt's runtime config.
nuxt.config.ts
Make sure that names of the keys in the runtimeConfig
object match the names
of your environment variables. Read more about this
here.
4
Configure libSQL Client.
server/utils/turso.ts
5
Execute SQL
server/api/items.get.ts