import { withApi } from "bknd/adapter/nextjs"; import type { InferGetServerSidePropsType } from "next"; export const getServerSideProps = withApi(async (context) => { const { data = [] } = await context.api.data.readMany("todos"); const user = context.api.getUser(); return { props: { data, user } }; }); export default function Home({ data, user }: InferGetServerSidePropsType) { return (

Data

{JSON.stringify(data, null, 2)}

User

{JSON.stringify(user, null, 2)}
); }