Embed Kbee on your page
Last updated by Sandeep Dinesh 6 hours ago
Using the KBee Embedded SDK, you can embed Kbee on your page. You can even embed Kbee behind your own login!
Install Kbee Embedded
On your website, add the following script tag to your pageβs <HEAD> tag:
<script src="https://cdn.jsdelivr.net/gh/kbee-app/embedded@latest/dist/kbee-embedded.js"></script>
You can now select a target to render the Kbee content into. The Kbee SDK will automatically authenticate your users if you are using password protection.
Kbee.render({
target: '#kbee-content',
spaceUrl: 'https://yourspace.kbee.app',
apiKey: '<YOUR-API-KEY>'
})
Sample HTML
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title> YOUR TITLE </title>
<script src="https://cdn.jsdelivr.net/gh/kbee-app/embedded@latest/dist/kbee-embedded.js"></script>
</head>
<body>
<div id="kbee-content" style="width:100vw;height:100vh"></div>
<script>
Kbee.render({
target: '#kbee-content',
spaceUrl: 'https://yourspace.kbee.app',
apiKey: '<YOUR-API-KEY>'
})
</script>
</body>
</html>
This sample should get you up and running quickly!
Security Considerations
Embedded mode lets users access your space even if access to your space is restricted. Anyone who can access the embedded page can access your space. This is very convenient when you want to lock access behind your own login, but there are some things to be aware of.
Google Docs
If your space only consists of Google Docs, everything will work as expected in embedded mode.
Other content (PDFs, Slides, Sheets, etc)
Non Docs content requires the user to have access to the underlying item in Google Drive. If you know who the users or groups accessing your space will be, you can add them in Kbee or Google Drive.
If you do not know ahead of time who your users will be, the best choice is to turn on link sharing on the space. This will allow anyone to view the content without needing to be explicitly shared on Google Drive.
However, this means that folks who guess your Google Drive folderβs ID will be able to view your content. Guessing this ID is not easy, but it may be possible.