This SDK provides native Unity support for Bolt Ads and Web Payments. We also support other platforms:
![]() JavaScript Javascript SDK |
![]()
Unity
This Repo |
Unreal Engine Unreal SDK |
|
iOS Coming Soon π§ |
Android Coming Soon π§ |
For further documentation and API reference visit our Quickstart guide.
Only with Bolt you get 2.1% + $0.30 on all transactions. That's 10x better than traditional app stores which take 30% of your revenue! That's the fair and transparent pricing you get with using Bolt.
Boltβs fees are subject to change but will remain highly competitive. For the latest rates, see Bolt Pricing. For details, review the End User Terms and Conditions.
You need 3 things to get started:
- Existing App: You will need an application in the same platform as this SDK
- Backend Server: You will need to bring your own backend server (any language)
- Bolt Merchant Account: Dashboard access to manage your store (sign up or log in)
- UniWebViewAdService.cs Unity plugin supporting iOS and Android in-game webviews
UniWebView is a Unity plugin supporting in-game webviews for iOS and Android mobile games. In order to install, please refer to the UniWebView installation guide here.
Note: You are open to follow the installation method of your preference. Most convenient options would be through the Unity Asset Store or UniWebView's own web store.
Note: For any of these options you can specify a specific version by appending it to the URL with a hashtag, e.g. https://github.com/BoltApp/bolt-unity-sdk.git#v0.0.5 will pin v0.0.5
- Open your Unity project
- Navigate to the Packages folder in your project root
- Open the
manifest.jsonfile in a text editor - Add the Bolt SDK dependency to the
dependenciessection:
{
"dependencies": {
"com.bolt.sdk": "https://github.com/BoltApp/bolt-unity-sdk.git#main",
// ... other dependencies
}
}- Save the file - Unity will automatically download and import the package
- Open Package Manager in Unity (Window > Package Manager)
- Click the "+" button in the top-left corner
- Select "Add package from git URL"
- Enter the repository URL:
https://github.com/BoltApp/bolt-unity-sdk.git#main - Click "Add"
If you have any issues our discord support team will be happy to help.
Under your game's project settings, go to Player and make the following changes:
- Find the
Other Settingssection, at the bottom of this section you will seeScript Compilation - Add both
BOLT_SDKandUNIWEBVIEWas scripting define symbols
There are various sample integrations in the Samples~/ folder.
- Copy these files from
Samples~/AdsIntegration/to your game's source code:
- BoltClient.cs: Your game's scripts folder (e.g.,
Assets/Scripts/Bolt/) - UniWebViewAdService.cs: Your game's service layer (e.g.,
Assets/Scripts/Services/)
-
Update both
BoltClient.csandUniWebViewAdService.csso their namespaces reference your project's paths -
Update
BoltClient.csin theInitializeBoltSDK()method (around lines 13-14)
gameId- Your Bolt game ID (replace"com.myapp.test")publishableKey- Your Bolt publishable key (replace"example.publishable.key")Environment- Set toBoltConfig.Environment.Development,BoltConfig.Environment.Sandbox, orBoltConfig.Environment.Production(currently defaults toSandboxon line 36)
- Create an empty GameObject in your scene
- Add the
BoltClientcomponent to it - The client will initialize automatically on
Start()
Start by setting up a button in Unity:
- In your code, create a new function that calls the BoltClient's
ShowAd()function - In Unity, click on the asset you want to trigger the ad and attach the function via the Unity Inspector's On Click() button setup
The client already handles initialization, ad preloading, etc. so at this point you can simply add the following function call
public void ExampleAdButton()
{
// ... add any other button logic required
BoltClient.Instance.ShowAd();
}The OnAdOpened() and OnAdCompleted() methods in BoltClient allow you to add things like UI updates, game state management, player rewards, etc.
The ad page uses UniWebView's Channel Messaging API to send a callback when the user closes a given ad.
- When the claim button is clicked, the ad page calls
window.uniwebview.send('bolt-gaming-issue-reward', ...) UniWebViewAdServicecatches this viaOnChannelMessageReceived- This fires the
onAdCompletedevent in yourBoltClient
What this means for you:
- The callback is handled automatically
- To handle rewards logic, update BoltClient's
OnAdCompleted()(line 95)
The SDK doesn't include UniWebView as a dependency. Your game provides the implementation via IAdWebViewService.
Copy UniWebViewAdService.cs anywhere that your BoltClient.cs file can reference, not the SDK folder.
While not necessary, it is safe to call the SDK's preloadAd function multiple times. The webview is created once and reused.
Only one ad can be active at a time. If you call ShowAd while an ad is already showing, the previous session will be replaced.
Here are some details on the payments integration which has some key differences to the Ads example above.
Integration examples are also provided in the Samples~/ folder.
- BoltBasicExample: will showcase how to initialize the client and check for pending transactions
- BoltDeepLinkExample: will showcase how to handle deep links back into the application.
You will need to bring your own backend server to complete integration for web payments.
- Quickstart: View our quickstart guide to get the API running
- Example Server: We also have a sample server in NodeJS for your reference during implementation
Get help and chat with us about anything on Discord
This project is licensed under the MIT License - see the LICENSE file for details.


