Get Started
Add RPC Edge to your application
To enable RPC Edge usage in an application, obtain a thirdweb Client ID & Secret Key with RPC Edge enabled and pass it into the app's configuration.
Obtain a Client ID & Secret Key by navigating to Settings > API Keys > Create API Key
.
When navigating the prompts for key creation, ensure that RPC is enabled.
Pass in the Client ID and Secret Keys into the application’s configuration.
- Typescript
- React
- Unity
- Python
- GO
When writing backends or scripts, you can use the secret key to instantiate the SDK:
// Read-only mode
const readOnlySdk = new ThirdwebSDK("<chain_id>", {
secretKey: "<your_secret_key>",
});
When using the Typescript SDK for frontend applications, use the client id:
const readOnlySdk = new ThirdwebSDK("<chain_id>", {
clientId: "<your_client_id>",
});
import { ThirdwebProvider } from "@thirdweb-dev/react";
function MyApp() {
return (
<ThirdwebProvider clientId="<your_client_id>">
<YourApp />
</ThirdwebProvider>
);
}
When using the Unity SDK, you can use the client id to instantiate the SDK:
ThirdwebSDK sdk = new ThirdwebSDK("<chain_id>", 5, new ThirdwebSDK.Options()
{
clientId = "<your_client_id>",
});
When using the Python SDK, use the secret key to instantiate the SDK:
sdk = ThirdwebSDK.from_private_key(
<private_key>,
"<chain_id>",
SDKOptions(secret_key=<your_secret_key>)
)
When using the GO SDK, you can use the secret key to instantiate the SDK:
func main() {
// Your secret key from the thirdweb api keys dashboard
secretKey := "<your_secret_key"
sdk, err := thirdweb.NewThirdwebSDK("<chain_id>", &thirdweb.SDKOptions{
SecretKey: <your_secret_key>,
})
}
Override default RPC
To override the default RPC for any given chain:
- Typescript
- React
import { ThirdwebSDK } from "@thirdweb-dev/sdk";
const sdk = new ThirdwebSDK({
rpc: ["https://<your-rpc-to-use>.com"],
});
import { ThirdwebProvider } from "@thirdweb-dev/react";
const App = () => {
return (
<ThirdwebProvider
activeChain={{
rpc: ["https://<your-rpc-to-use>.com"],
}}
>
<YourApp />
</ThirdwebProvider>
);
};
Public RPCs can be used without an API Key. Refer to the configured chains page.
View RPC usage
View RPC request usage in the dashboard settings.