Natively Docs
Join our community 🔥
  • 👩‍🚀Getting Started
    • What is Natively?
    • Why Natively?
    • FAQ
    • Create Your First App
  • 🚀Natively Platform
    • 🚉Releases
    • 🖌️Appearance
      • 😼App Icon
      • 📱Loading Screen
      • 📱Error Screen
      • 🎨Style
    • 🎬Preview
    • ⭐Features
      • 🛳️Bottom Bar
      • 🚇Deeplinks
        • 🔥Firebase
        • 🔗Universal Links
        • 🌱Branch.io
      • 📍Geolocation
      • 🔔Notifications
        • 📲OneSignal Notifications
        • 🔥Firebase Notifications (Advanced)
      • 📒Contacts
      • 👩‍🎨Social Auth
        • 🍏Sign In with Apple
      • 💟HealthKit
      • 💰Purchases
      • 🤑Admob
      • 💳NFC
      • 📷Camera
      • 📂Photo Library
      • 🎤Microphone
      • 📈Analytics
        • 🕊️AppsFlyer
        • 😛Facebook
    • 🚚Publish
      • 🍏iOS App
      • 🤖Android App
    • ⚙️Settings
    • 🙈Subscription Plans
  • Guides
    • 🧋Integration (Native Features)
      • 🏅How to get started?
      • ℹ️Device
      • ℹ️Browser Info
      • 🛳️Bottom Bar
      • ✂️Clipboard
      • 🚦Push Notifications - OneSignal
      • 🚦Push Notifications - Firebase (Advanced)
      • 📍Geolocation
      • 📦App Storage
      • 🗝️Biometrics & Credentials
      • 📧Native SMS/Email
      • 📅Native Date Picker
      • 📸Native Camera
      • 🎙️Native Audio Recorder
      • 🈁Native Scanner (QR/Barcode)
      • 📔Contacts
      • 🍏Apple Sign In
      • ❤️HealthKit
      • 💸In-App Purchases
      • 🤑Admob
      • 💳NFC
      • 🥑Show Toast/Banner
      • ⏳Show/Hide Loading Screen
      • 🥑Haptic Feedback
      • 🖼️Share Media/Files
      • 📱Open an external App/URL
      • ✍️Request User's review
      • ↔️getInsets
      • 🎨Control Style & Colors
    • 🔍Troubleshooting
    • 🐈Setup RevenueCat App
    • 🚑Setup Admob App
    • 🚥Setup One Signal App
    • 🧑‍🤝‍🧑Setup website Universal Links (Deeplinks)
    • 🍕Testing & Submitting your app
    • 🔑Generate iOS Push Key (NEW)
    • 🔑Generate iOS Push Certificate (Legacy)
    • 🤝Affiliate program
    • 📕For Partners: Natively Brand Book.
Powered by GitBook
On this page
  • 🧋 Bubble.io Plugin
  • 🛠 JavaScript SDK
  • 🛠 React/NextJS (min version 2.15.3)
  • Debugging (Inspect console inside of mobile app)

Was this helpful?

  1. Guides
  2. Integration (Native Features)

How to get started?

PreviousIntegration (Native Features)NextDevice

Last updated 5 months ago

Was this helpful?

🧋 Bubble.io Plugin

We're not recommending calling any Natively 'Get Value' API in such events as "Page Is Loaded", "User is logged in" or any similar. Sometimes they can be called before Natively was injected into your website, and cause a value empty state.

If you're planning to use bubble, check out our example setup app editor:

Username: 1 Password: 1

First of all, you need to add a to your bubble app. To do this, go to the Plugins tab and search for Natively:

Click Install:

If you are planning to use a Push Notifications feature in your app fill out onesignal_appId & onesignal_apiKey fields:

You can find these values on your OneSignal app page:

mode (headers) - Optional

Possible values:

  • "debug" - show errors in the console or display error alerts (For debugging purposes)

"preview" should be enabled only if you're testing the app in a Preview Mode; otherwise, Push Notifications will not work inside your app.

Open Debug Console

To open Debug Console, use -> Natively - Open Debug Console action in the plugin

🛠 JavaScript SDK

Put the following code in your website header (between <head></head> tags)

<head>
<script async onload="nativelyOnLoad()" src="https://cdn.jsdelivr.net/npm/natively@2.15.3/natively-frontend.min.js"></script>
</head>

You can specify an SDK version by replacing version number 2.15.3

To turn on Debug mode, please insert the following code after SDK import:

<head>
<script async onload="nativelyOnLoad()" src="https://cdn.jsdelivr.net/npm/natively@2.15.3/natively-frontend.min.js"></script>
<script>
function nativelyOnLoad() {
    window.natively.setDebug(true); // To see errors
}
</script>
</head>

Debug mode which enables native alerts with errors. It's can be very useful while you developing a website.

🛠 React/NextJS (min version 2.15.3)

Installation:

npm i natively@">=2.15.3"

Usage:

'use client'; // <--- THIS IS IMPORTANT, Natively can't be used on server side
import { NativelyInfo, useNatively } from 'natively';

export default function Home() {
  const natively = useNatively(); // <--- useNatively is just a wrapper on window.natively
  const info = new NativelyInfo();
  const browserInfo = info.browserInfo();
  const openConsole = () => {
    natively.openConsole();
  };
  console.log(browserInfo);
  return (
    <div>
      Check the console for browser info. isNativeApp: {browserInfo.isNativeApp ? "true" : "false"}
      <button onClick={openConsole}>Open Console</button>
    </div>
  );
};

Important for NextJS users make sure to add 'use client' to the component where you're using Natively SDK.

"useNatively" is referring to "window.natively" everywhere in this documentation.

Debugging (Inspect console inside of mobile app)

// Make sure you have JS SDK >=v2.7.2
window.natively.openConsole();

// NextJS/React
import { useNatively } from 'natively';
const natively = useNatively();
natively.openConsole();

"preview" - To test the app in a (For now, only feature requires this)

The latest version number can be found in repo.

Example project:

🧋
🏅
this
https://github.com/romanfurman6/nextjs-boilerplate
Preview mode
Push Notifications
https://bubble.io/page?name=index&id=nativelyqa&tab=tabs-1
plugin
Bubble.io Plugin
JavaScript SDK
React/NextJS
Debugging