• Blog
  • Documentation
  • Courses
  • Changelog
  • AI Starters
  • UI Kit
  • FAQ
  • Supamode
    New
  • Pricing

Launch your next SaaS in record time with Makerkit, a React SaaS Boilerplate for Next.js and Supabase.

Makerkit is a product of Makerkit Pte Ltd (registered in the Republic of Singapore)Company Registration No: 202407149CFor support or inquiries, please contact us

About
  • FAQ
  • Contact
  • Verify your Discord
  • Consultation
  • Open Source
  • Become an Affiliate
Product
  • Documentation
  • Blog
  • Changelog
  • UI Blocks
  • Figma UI Kit
  • AI SaaS Starters
License
  • Activate License
  • Upgrade License
  • Invite Member
Legal
  • Terms of License
  • Global Configuration
    • Environment Variables
    • Feature Flags
  • Server Actions
    • Sending CSRF Token to Actions
    • Server Actions Error Handling
  • The Makerkit SDK
    • User SDK
    • Organization SDK
    • Organization Subscription SDK
    • Data Loader SDK
  • Architecture and Folder Structure
    • Structure your Application
    • Data Model
    • Overview
    • User Permissions
    • Subscription Permissions
    • RLS Policies
    • Custom React Hooks
This documentation is for a legacy version of Next.js and Supabase. For the latest version, please visit the Next.js and Supabase V2 documentation

Organization React Hooks | Next.js Supabase SaaS Kit

Reference for the organizations React hooks in your Next.js Supabase SaaS Kit

useCurrentOrganization

This hook returns the current organization. It's a wrapper around the OrganizationContext context. The returned value is an Organization object.

import { useCurrentOrganization } from '~/lib/organizations/hooks/use-current-organization';
const organzation = useCurrentOrganization();

useIsSubscriptionActive

This hook returns a boolean indicating whether the current organization has an active subscription. It's a shortcut around the useCurrentOrganization hook that checks if the status property is set to active or trialing.

import { useIsSubscriptionActive } from '~/lib/organizations/hooks/use-is-subscription-active';
const isSubscriptionActive = useIsSubscriptionActive();

Other Organization Hooks

The kit has many more hooks that are used internally: they are not meant to be used directly unless you want to update the logic or fix a bug.

All the hooks are available in the ~/lib/organizations/hooks directory.

On this page
  1. useCurrentOrganization
    1. useIsSubscriptionActive
      1. Other Organization Hooks