AutumnA
Autumn4mo ago
29 replies
The Untraceable

When trying to attach (I want to upgrade

When trying to attach (I want to upgrade the user plan to Pro, under id pro), I get this error. I have set AUTUMN_SECRET_KEY in my Convex env, my .env.local file. Getting the customer is working, just not attaching. Here is my code.
"use client";

import { RainbowButton } from "@/components/ui/rainbow-button";
import { Autumn as autumn } from "autumn-js";
export const UpgradeSubscription = ({
    customerId,
    isPro,
}: {
    customerId: string;
    isPro: boolean;
}) => {
    return (
        <RainbowButton
            disabled={isPro}
            onClick={async () => {
                await autumn.checkout({
                    customer_id: customerId,
                    product_id: "pro",                    
                });
            }}
        >
            {isPro ? "Upgrade to Pro" : "You are a Pro User"}
        </RainbowButton>
    );
};
image.png
Was this page helpful?