so basically something like this?
so basically something like this?
or does the url have to be
import { auth } from "@mypkg/auth";
import { autumnHandler } from "autumn-js/fastify";
import { fromNodeHeaders } from "better-auth/node";
import type { FastifyInstance } from "fastify";
export async function autumn(fastify: FastifyInstance) {
fastify.route({
handler: autumnHandler({
identify: async (request) => {
const { session, user } = (await auth.api.getSession({
headers: fromNodeHeaders(request.headers),
})) ?? { session: null, user: null };
return {
customerData: {
email: user?.email,
name: user?.name,
},
customerId: session?.activeOrganizationId?.toString(),
};
},
}),
method: ["GET", "POST"],
url: "/autumn/*",
});
}import { auth } from "@mypkg/auth";
import { autumnHandler } from "autumn-js/fastify";
import { fromNodeHeaders } from "better-auth/node";
import type { FastifyInstance } from "fastify";
export async function autumn(fastify: FastifyInstance) {
fastify.route({
handler: autumnHandler({
identify: async (request) => {
const { session, user } = (await auth.api.getSession({
headers: fromNodeHeaders(request.headers),
})) ?? { session: null, user: null };
return {
customerData: {
email: user?.email,
name: user?.name,
},
customerId: session?.activeOrganizationId?.toString(),
};
},
}),
method: ["GET", "POST"],
url: "/autumn/*",
});
}or does the url have to be
/api/autumn/*/api/autumn/*? if not, how does it work with the AutumnProviderAutumnProvider on the frontend?