You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/baseai.dev/content/docs/guides/nextjs-with-baseai.mdx
+40-21Lines changed: 40 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ This guide covers building AI features in a Next.js app using BaseAI, focusing o
19
19
20
20
## Next.js with BaseAI Example
21
21
22
-
We also have pre-built a Next.js app with BaseAI for you to get started quickly. You can refer to the following resources to understand how to build a Next.js app with BaseAI.
22
+
We also have pre-built a Next.js app with BaseAI for you to get started quickly. You can refer to the following resources to understand how to build a Next.js app with BaseAI.
23
23
24
24
-[Next.js with BaseAI](https://github.com/LangbaseInc/baseai/tree/main/examples/nextjs)
25
25
-[Example of using BaseAI](https://github.com/LangbaseInc/baseai/tree/main/examples/nextjs/app/demo)
@@ -37,7 +37,7 @@ We also have pre-built a Next.js app with BaseAI for you to get started quickly.
`LANGBASE_API_KEY` is the user or org API key that you authenticated with. You can obtain your [User/Org API Key](https://langbase.com/docs/api-reference/api-keys) from the Langbase dashboard.
365
+
366
+
---
367
+
368
+
## Step #8: Run the Next.js BaseAI App
337
369
338
370
Run BaseAI dev server and start the Next.js app.
339
371
@@ -348,33 +380,20 @@ Write a prompt message and click on the `Ask AI` button to generate the completi
348
380
349
381
---
350
382
351
-
## Step #8: Deploy BaseAI project on Langbase
383
+
## Step #9: Deploy BaseAI project on Langbase
352
384
353
385
To deploy the project on Langbase, you need to authenticate with your Langbase account.
354
386
355
387
```bash
356
388
npx baseai@latest auth
357
389
```
358
390
359
-
After authentication, you can deploy the project using the following command.
391
+
After authentication, you can deploy the project using the following command. When you deploy, you need to add keys for providers like OpenAI, Google, etc., in [Langbase Keysets](https://langbase.com/docs/features/keysets).
360
392
361
393
```bash
362
394
npx baseai@latest deploy
363
395
```
364
396
365
-
This will deploy your project on Langbase and you can access it as a highly scalable API. Check the [BaseAI `deploy` documentation](https://baseai.dev/docs/deployment/deploy) for more details.
397
+
This will deploy your project on Langbase and you can access it as a serverless highly scalable API. Check the [BaseAI `deploy` documentation](https://baseai.dev/docs/deployment/deploy) for more details.
366
398
367
399
---
368
-
369
-
## Step #9: Deploy Next.js app
370
-
371
-
Deploy your Next.js app using Vercel or any other hosting provider and set the following environment variables.
372
-
373
-
```bash
374
-
OPENAI_API_KEY=""#your_openai_api_key
375
-
LANGBASE_API_KEY=""#your_langbase_api_key
376
-
```
377
-
378
-
Langbase API key is the user or org API key that you authenticated with. You can obtain your [User/Org API Key](https://langbase.com/docs/api-reference/api-keys) from the Langbase dashboard.
0 commit comments