Skip to content

Files

Latest commit

dcd6fe3 · Nov 22, 2023

History

History
34 lines (24 loc) · 593 Bytes

remix.md

File metadata and controls

34 lines (24 loc) · 593 Bytes

Setting up Remix

Credentials

In the root of your project, create a .env file and add your OpenAI API key:

OPENAI_API_KEY=sk-...

Install Beak.js for Remix

npm install @beak/remix --save
# or
yarn add @beak/remix

Add the Beak.js handler

Create a new wildcard API route in app/routes/beak.$.tsx:

import { beakHandler } from "@beakjs/remix";
export const action = beakHandler();

Configure Beak to use the Remix backend

const App = () => {
  return <Beak baseUrl="/beak">... your app code goes here</Beak>;
};