-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Reo.Dev integration * Add index.ts file * Run npm install to update package-lock.json * Rename folder to reo * Delete old files * Fix linter errors * Update contentSecurityPolicy * Update configuration based on coming site updates * Update manifest for reo integration * Update package lock * Add new dependencies to pakcage lock * fix conflicts in package-lock --------- Co-authored-by: Addison <[email protected]> Co-authored-by: taranvohra <[email protected]> Co-authored-by: Addison <[email protected]>
- Loading branch information
1 parent
fc8b0e5
commit c9f4cf9
Showing
9 changed files
with
147 additions
and
1 deletion.
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,51 @@ | ||
name: reodotdev | ||
title: Reo.dev | ||
icon: ./assets/icon.png | ||
previewImages: | ||
- ./assets/preview.png | ||
description: Plug your GitBook site to your Reo.dev installation. | ||
externalLinks: | ||
- label: Website | ||
url: https://www.reo.dev/ | ||
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 | ||
- site:script:inject | ||
organization: d8f63b60-89ae-11e7-8574-5927d48c4877 | ||
contentSecurityPolicy: | ||
script-src: static.reo.dev www.ipapi.co; | ||
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 Reo.dev 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 Reo.dev's client ID you want to use, which is available in Reo.dev's Integration -> Documentation section | ||
categories: | ||
- analytics | ||
configurations: | ||
space: | ||
properties: | ||
tracking_id: | ||
type: string | ||
title: Client ID | ||
description: Available in Reo.dev's Integration -> Documentation section | ||
required: | ||
- tracking_id | ||
site: | ||
properties: | ||
tracking_id: | ||
type: string | ||
title: Client ID | ||
description: Available in Reo.dev'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,42 @@ | ||
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.siteInstallation?.configuration?.tracking_id ?? | ||
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.