@ramp/kritkit
v0.2.0
Published
KritKit ships the prototype feedback widget and the embedded server module in one package.
Maintainers
Keywords
Readme
@ramp/kritkit
KritKit ships the prototype feedback widget and the embedded server module in one package.
Install
npx @ramp/kritkit initThe installer currently handles Vite prototypes. It adds the widget provider, mounts the embedded server at /kritkit-api, writes local KritKit env keys, and creates a Ramplify Procfile migration target for managed Postgres.
npx @ramp/kritkit init \
--notion-parent-page-id <notion-page-id> \
--creator-email [email protected]After deploying, enable Postgres in Ramplify, grant Notion integration access, share the destination parent page with the Ramplify Notion integration, and leave KRITKIT_RUN_MIGRATIONS unset so the generated Procfile migration handles schema setup. On Ramplify, Notion sync uses the platform integrations proxy (INTEGRATIONS_URL + INTEGRATIONS_KEY) when available; set KRITKIT_NOTION_TOKEN only for local development.
Client
import { KritKitProvider } from "@ramp/kritkit";
export function App() {
return (
<KritKitProvider apiOrigin="/kritkit-api">
{/* prototype */}
</KritKitProvider>
);
}Server
import { PostgresKritKitDatabase } from "@ramp/kritkit/server";
import { createKritKitExpressMiddleware } from "@ramp/kritkit/server/express";
const database = new PostgresKritKitDatabase(process.env.DATABASE_URL!);
await database.migrate();
app.use(
"/kritkit-api",
createKritKitExpressMiddleware({
database,
notionParentPageId: process.env.KRITKIT_NOTION_PARENT_PAGE_ID,
}),
);Vite
import { defineConfig } from "vite";
import { PostgresKritKitDatabase } from "@ramp/kritkit/server";
import { kritKitVitePlugin } from "@ramp/kritkit/server/vite";
const database = new PostgresKritKitDatabase(process.env.DATABASE_URL!);
export default defineConfig({
plugins: [
kritKitVitePlugin({
database,
notionParentPageId: process.env.KRITKIT_NOTION_PARENT_PAGE_ID,
defaultCreatorEmail: process.env.KRITKIT_DEFAULT_CREATOR_EMAIL,
runMigrations: process.env.KRITKIT_RUN_MIGRATIONS === "true",
}),
],
});On Ramplify, grant the app Notion integration access, share the destination parent page with the Ramplify Notion integration, and set KRITKIT_NOTION_PARENT_PAGE_ID; KritKit will use INTEGRATIONS_URL + INTEGRATIONS_KEY automatically. For local dev, set KRITKIT_NOTION_TOKEN or pass a custom notion client. If Notion is not configured, feedback still saves and sync is skipped.
