-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b95d216
commit 528fee4
Showing
9 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": ["@gitbook/eslint-config/integration"] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: reodotdev | ||
title: Reodotdev | ||
icon: ./assets/icon.png | ||
previewImages: | ||
- ./assets/preview.png | ||
description: Plug your GitBook site to your Reo.dev installation. | ||
externalLinks: | ||
- label: Documentation | ||
url: https://www.gitbook.com/integrations/reodotdev | ||
visibility: public | ||
script: ./src/index.ts | ||
# The following scope(s) are available only to GitBook Staff | ||
# See https://developer.gitbook.com/integrations/configurations#scopes | ||
scopes: | ||
- space:script:inject | ||
organization: d8f63b60-89ae-11e7-8574-5927d48c4877 | ||
contentSecurityPolicy: | ||
script-src: static.reo.dev; | ||
summary: | | ||
# Overview | ||
Reo.Dev is the Business to Developer (B2D) ABM platform that helps you find revenue opportunity from developer activity. | ||
This integration lets you add the Reo.Dev Javascript on your published GitBook site to seamlessly analyze developer intent through any interactions with your content on GitBook. | ||
# How it works | ||
The integration injects the Reodotdev script on your page, using the configured client ID, | ||
so that you can get analytics information from your GitBook site directly inside of Reo. | ||
# Configure | ||
Install the integration on the GitBook space of your choice. | ||
Locate the Reodotdev's client ID you want to use, which is available in Reodotdev's Integration -> Documentation section | ||
categories: | ||
- analytics | ||
configurations: | ||
space: | ||
properties: | ||
tracking_id: | ||
type: string | ||
title: Client ID | ||
description: Available in Reodotdev's Integration -> Documentation section | ||
required: | ||
- tracking_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "@gitbook/integration-reo.dev", | ||
"version": "0.0.1", | ||
"private": true, | ||
"dependencies": { | ||
"@gitbook/api": "*", | ||
"@gitbook/runtime": "*" | ||
}, | ||
"devDependencies": { | ||
"@gitbook/cli": "*" | ||
}, | ||
"scripts": { | ||
"lint": "eslint ./src/**/*.ts", | ||
"typecheck": "tsc --noEmit", | ||
"publish-integrations-staging": "gitbook publish .", | ||
"publish-integrations": "gitbook publish ." | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { | ||
createIntegration, | ||
FetchPublishScriptEventCallback, | ||
RuntimeContext, | ||
RuntimeEnvironment, | ||
} from '@gitbook/runtime'; | ||
|
||
import script from './script.raw.js'; | ||
|
||
type ReoDotDevRuntimeContext = RuntimeContext< | ||
RuntimeEnvironment< | ||
{}, | ||
{ | ||
tracking_id?: string; | ||
} | ||
> | ||
>; | ||
|
||
export const handleFetchEvent: FetchPublishScriptEventCallback = async ( | ||
event, | ||
{ environment }: ReoDotDevRuntimeContext | ||
) => { | ||
const trackingId = environment.spaceInstallation.configuration.tracking_id; | ||
if (!trackingId) { | ||
throw new Error( | ||
`The Reo.Dev tracking ID is missing from the configuration (ID: ${event.spaceId}).` | ||
); | ||
} | ||
|
||
return new Response(script.replace('<TO_REPLACE>', trackingId), { | ||
headers: { | ||
'Content-Type': 'application/javascript', | ||
'Cache-Control': 'max-age=604800', | ||
}, | ||
}); | ||
}; | ||
|
||
export default createIntegration<ReoDotDevRuntimeContext>({ | ||
fetch_published_script: handleFetchEvent, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const trackingID = '<TO_REPLACE>'; | ||
|
||
(function (r, e, o) { | ||
var t, c, n; | ||
c = { clientID: trackingID }; | ||
t = function () { | ||
Reo.init(c); | ||
}; | ||
n = e.createElement("script"); | ||
n.src = o + c.clientID + '/reo.js'; | ||
n.async = !0; | ||
n.onload = t; | ||
|
||
e.head.appendChild(n); | ||
})(window, document, "https://static.reo.dev/"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "@gitbook/tsconfig/integration.json" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.