BHD Ads

For developers

Show an ad with three lines, or run everything from your server.

BHD Ads has a web SDK for websites and an HTTP API for apps and servers. Both have a test mode that never charges and never pays.

Two ways to integrate

Choose the path that fits your product

Web SDK

For websites. Add the script and one element. The SDK requests the ad, shows it, counts the view and handles the tap.

html
<script async src="https://ads.bhd.om/v1/sdk.js"></script>
<ins class="bhd-ad" data-key="pk_test_YOUR_KEY"
     data-unit="unit_YOUR_UNIT"></ins>

Web SDK reference

Server to server API

For apps and custom builds. Request an ad with a publishable key and show it yourself. Manage campaigns and read reports with a secret key.

bash
curl "https://ads.bhd.om/v1/ad?unit=unit_YOUR_UNIT&lang=en&os=ios" \
  -H "Authorization: Bearer pk_test_YOUR_KEY"

Ad request · Account API

Test mode and live mode

Build in test mode, then change the key

ItemTest modeLive mode
Keyspk_test_ sk_test_pk_live_ sk_live_
PropertyWorks at onceWorks after BHD approves it
AdsA test campaign when one matches, else a built-in ad marked TESTA real ad when one matches, or no ad
MoneyNever charged, never earnedPaid views are charged and earn
Website domain checkOffOn: the registered domain and its subdomains
Campaign paymentA test payment that moves no moneyBy card, when BHD opens card payments

Keys

Two kinds of key

Publishable key
Starts with pk_test_ or pk_live_. It can only request ads. You can put it in a page or an app.
Secret key
Starts with sk_test_ or sk_live_. It calls the account API: campaigns, reports, earnings. Keep it on your server only. Never put it in a page, an app or a repository.
Where keys come from
An organization admin creates keys in the console. A key is shown one time. You can revoke a key at any time.

What exists today

An honest list

Web SDK
Available. One script, no dependencies, no cookies.
HTTP API
Available. Ad requests, campaigns, reports, earnings and webhooks.
iOS and Android SDK packages
Not yet. Apps call the HTTP API and show the ad with their own views. The docs have Swift and Kotlin code.
Rewarded ads and Google mediation
For BHD apps only today.
Screen advertising
Not open. The network has no screens today.
Live card payments
Open when BHD switches them on. Test payments work now.

Before you go live

Integration checklist

  1. Create a test property, an ad unit and a publishable test key in the console.
  2. Show the test ad. Check that it carries the TEST tag.
  3. Keep the secret key on your server. Never put it in a page, an app or a repository.
  4. Count a view only when at least half of the ad is on the screen for one second. The web SDK does this for you.
  5. Open clickUrl on a tap. Do not open the destination link directly.
  6. Handle the empty answer. When there is no ad, show nothing or show your own content.
  7. Pass consent when you know the choice of the person. Never send personal data.
  8. If you use webhooks, verify the signature and reject a timestamp older than 5 minutes.
  9. Add your live property and wait for the approval email.
  10. Put the live key in place of the test key. On a website, the live key works only on the registered domain.