Building on Farcaster with Next.js
This guide will get you all set up and ready to use the Castr GÜRŲ SDK. We'll cover how to get started using one of our SDK clients and how to make your first API request. We'll also look at where to go next to find all the information you need to take full advantage of our powerful REST API.
There is NO signup required to start making requests to the Castr GÜRŲ Cloud — however, we recommend you register a Frame ID from your Cloud dashboard to access full features. You'll find it under Settings » API.
Install Telemetry
Next.js has a lovely Script component.
In your app, you can add this Script component. You can use the App Router, the Pages Router, or the pre Next.js 13 way.
App Router
// app/layout.js
import Script from 'next/script'
export default function RootLayout({ children }) {
return (
<html lang="en">
<body>{children}</body>
<Script src="https://telemetry.castr.guru/script.js" />
</html>
)
}
Pages Router
// pages/_app.js
import Script from 'next/script'
export default function MyApp({ Component, pageProps }) {
return (
<>
<Component {...pageProps} />
<Script src="https://telemetry.castr.guru/script.js" />
</>
)
}
What's next?
Great, you're now set up with an API client and have made your first request to the Cloud. Here are a few links that might be handy as you venture further into the Castr GÜRŲ SDK: