Memberstack Playground
Welcome to the Memberstack Playground! This interactive environment lets you test Memberstack DOM package features using your public key. Try out different methods and see how they work in real-time.
Initialize Memberstack
Enter your public key to initialize the Memberstack DOM package. This will enable the "Run Code" buttons.
Authentication
This section covers user authentication, including signup, login, logout, and handling authentication state changes.
Methods:
Signup Member (Email/Password)
Signs up a new member using email and password.
Login Member (Email/Password)
Logs in an existing member with email and password.
Logout Member
Logs out the currently authenticated member.
Signup with Provider
Initiates the signup process using a third-party provider (e.g., Google, Facebook).
Login with Provider
Initiates the login process using a third-party provider.
Send Passwordless Login Email
Sends a passwordless login email to the specified email address.
Send Passwordless Signup Email
Sends a passwordless signup email to the specified email address.
Login with Passwordless Token
Logs in a member using a passwordless token received via email.
Signup with Passwordless Token
Signs up a new member using a passwordless token received via email.
On Authentication Change
Listens for changes in the member's authentication state.
Get Member Cookie
Retrieves the current member's authentication cookie.
Send Verification Email
Sends an email verification email to the currently logged-in member.
Pre-built Modals
This section demonstrates how to use Memberstack's pre-built modals for common authentication and profile management actions.
Methods:
Open Modal
Opens a pre-built Memberstack modal.
Hide Modal
Closes the currently open Memberstack modal.
Profile Management
This section covers methods for managing the current member's profile, including updating custom fields, and changing passwords.
Methods:
Get Current Member
Retrieves the currently logged-in member's data.
Update Member
Updates the current member's profile data (custom fields).
Delete Member
Deletes the current member's account and cancels any active subscriptions.
Update Member Authentication
Updates the current member's authentication details (email, password).
Update Member JSON
Updates the current member's JSON data.
Get Member JSON
Retrieves the current member's JSON data.
Send Password Reset Email
Sends a password reset email to the specified email address.
Reset Member Password
Resets a member's password using a reset token sent to a member.
Connect Provider
Connects a third-party provider (e.g., Google, Facebook) to the current member's account.
Disconnect Provider
Disconnects a third-party provider from the current member's account.
Update Member Profile Image
Updates the current member's profile image.
Plan Management
This section covers methods for managing the current member's plans, including adding, removing, and purchasing plans.
Get Plan
Retrieves information about a specific plan.
Get Plans
Retrieves a list of all available plans.
Add Plan
Adds a plan to the current member's account.
Remove Plan
Removes a plan from the current member's account.
Purchase Plans with Checkout
Initiates a Stripe Checkout session to purchase plans.
Launch Stripe Customer Portal
Launches the Stripe customer portal for managing subscriptions and billing.
Tips for Testing Plans
- For paid plans, use test card 4242 4242 4242 4242
- Free plans use planId, paid plans use priceId
- Check the Memberstack dashboard for your actual IDs
Other Methods
This section covers miscellaneous methods and utilities.
Get Secure Content (Hosted Content)
Retrieves secure content based on hosted content ID.
Set Password
Sets a new password for the current member.
FAQs
Here are some common questions and answers about using Memberstack in your projects:
Additional Tips
- Use test mode keys (starting with pk_sb_) for development
- Remember to handle errors in your code
- Check the console for additional debugging information
- Replace placeholder IDs with your actual plan and price IDs
Test Accounts
- Create test accounts with fake email addresses (e.g., test@example.com)
- Use secure but memorable passwords for testing
- Test mode allows up to 50 test members
- Test members can be deleted to free up space
Need Help?
Having trouble getting your login working? We're here to help!