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
The SDK includes sample integrations that you can import into your project via the Unity Package Manager.
- In the Unity Editor, open Window > Package Manager.
- Select the Bolt SDK package.
- In the right-hand pane, find the Samples section and click Import next to the desired sample (e.g.,
AdsIntegration).
This will copy the sample files into your Assets/Samples folder.
-
After importing the
AdsIntegrationsample, move the files fromAssets/Samples/Bolt SDK/<version>/AdsIntegrationinto your game's source code folders (e.g.,Assets/Scripts/). -
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()
To display an ad when a user clicks a button, attach a "listener" via code. This allows you to pass important tracking information to the Bolt ad server.
Create a new file to handle all button clicks. Similar to Step 4, attach this file to an empty GameObject in your scene. Inside this script's Start method, add one listener per unique button asset. Here's an example:
using UnityEngine;
using UnityEngine.UI;
using BoltApp.Samples; // Replace with your namespace
public class MyGameMenu : MonoBehaviour
{
public Button newLifeButton;
public Button bonusButton;
void Start()
{
// Attach a listener to each button
newLifeButton.onClick.AddListener(() => {
BoltClient.Instance.ShowAd("new_life_1", AdSurface.GameOver);
});
bonusButton.onClick.AddListener(() => {
BoltClient.Instance.ShowAd("bonus_1", AdSurface.MainMenu);
});
}
}The Unity Inspector only supports calling functions with zero or one argument (like just a string). Since ShowAd requires both a Button ID and an Ad Surface for analytics, using AddListener in code is the best way to handle multiple parameters.
By passing these two parameters, you can track exactly where and which button triggered an ad:
- Button ID: A unique string of your choosing to identify which specific UI element the user interacted with.
- Ad Surface: A categorized location in your game. Using these constants helps group your data:
AdSurface.MainMenuAdSurface.ShopAdSurface.LevelCompleteAdSurface.GameOverAdSurface.OtherAdSurface.Custom("your_custom_surface")
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.


