Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sam/provider api key #78

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open

Sam/provider api key #78

wants to merge 22 commits into from

Conversation

samfairbairn
Copy link
Collaborator

this branch takes the api key, app id and simplehash api key passed into the StoryKitProvider and passes it to to all api & simplehash requests, eliminating need for NEXT_PUBLIC_STORY_PROTOCOL_X_API_KEY and NEXT_PUBLIC_SIMPLE_HASH_API_KEY env variables

changes include:

  • apiKey, appId, chainName, apiVersion arguments for api functions getResource and listResource
  • simplehashId, simplehashKey arguments for simplehash functions
  • api and simplehash function hooks that pass chain & api data

from

  const { chain } = useStoryKitContext()
  const { data: licenseTermsData } = useQuery({
    queryKey: [RESOURCE_TYPE.LICENSE_TERMS, selectedLicenseTermsId],
    queryFn: () =>
      getResource(
        RESOURCE_TYPE.LICENSE_TERMS,
        selectedLicenseTermsId as string,
        chain.name as STORYKIT_SUPPORTED_CHAIN
      ),
    enabled: !!selectedLicenseTermsId,
  })

to

const { data: licenseTermsData } = useGetResource(RESOURCE_TYPE.LICENSE_TERMS, selectedLicenseTermsId as string)

Copy link

vercel bot commented Nov 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
storykit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 22, 2024 9:47am

@@ -7,7 +7,13 @@ export default function Providers({ children }: { children: React.ReactNode }) {
const queryClient = new QueryClient()
return (
<QueryClientProvider client={queryClient}>
<StoryKitProvider chain={STORYKIT_SUPPORTED_CHAIN.STORY_TESTNET} theme="my-theme">
<StoryKitProvider
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if StoryKitProvider is appropriate for API environment
It seems like those env vars are only needed for IP-related API calls. How about... move to IpProvider?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants