This operation is only available on the server.
Required Permissions
experience:attach
experience:create
Usage
Copy
Ask AI
import { whopSdk } from "@/lib/whop-sdk";
const result = await whopSdk.forums.findOrCreateForum({
// The ID of the access pass (whop) to attach the experience to. It looks like prod_xxxx.
accessPassId: "prod_XXXXXXXX",
// The ID of an existing experience. If supplied, this new forum experience will
// be attached to the first access pass (whop) of this experience. It looks like exp_xxxx.
experienceId: "exp_XXXXXXXX",
// The name of the forum experience to be created, shown to the user on the UI.
name: "some string" /* Required! */,
// This is who is allowed to create posts inside the forum. Select 'admin' if you
// only want the team members to post, or select 'everyone' if any member of the
// whop can post. Default value is 'admins'.
whoCanPost: "admins" /* Valid values: admins | everyone */,
});
Example output
Copy
Ask AI
const result = {
// The unique ID representing this experience
id: "xxxxxxxxxxx",
// Use this link to directly take users to the experience
link: "some string",
};