Sanity Library Reference Docs
    Preparing search index...

    Function useProjectId

    • React hook that returns the current project id

      Returns string

      The current project id

      function MyComponent() {
      const projectId = useProjectId()
      // ... do something with the project id ...
      }