Skip to content

Commit

Permalink
📝 Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
naelob committed Sep 18, 2024
1 parent 1feafe1 commit e33d874
Show file tree
Hide file tree
Showing 27 changed files with 133 additions and 81 deletions.
2 changes: 2 additions & 0 deletions apps/magic-link/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"

ARG VITE_BACKEND_DOMAIN
ARG VITE_WEBAPP_DOMAIN

ENV VITE_BACKEND_DOMAIN="$VITE_BACKEND_DOMAIN"
ENV VITE_WEBAPP_DOMAIN="$VITE_WEBAPP_DOMAIN"

RUN corepack enable

Expand Down
2 changes: 2 additions & 0 deletions apps/magic-link/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"

ARG VITE_BACKEND_DOMAIN
ARG VITE_WEBAPP_DOMAIN

ENV VITE_BACKEND_DOMAIN="$VITE_BACKEND_DOMAIN"
ENV VITE_WEBAPP_DOMAIN="$VITE_WEBAPP_DOMAIN"

RUN corepack enable

Expand Down
1 change: 1 addition & 0 deletions apps/magic-link/src/helpers/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const config = {
API_URL: import.meta.env.VITE_BACKEND_DOMAIN,
WEBAPP_URL: import.meta.env.VITE_WEBAPP_DOMAIN
};

export default config;
Expand Down
6 changes: 5 additions & 1 deletion apps/magic-link/src/lib/ProviderModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
import { Input } from "@/components/ui/input";
import { LoadingSpinner } from '@/components/ui/loading-spinner';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
import config from '@/helpers/config';
import useCreateApiKeyConnection from '@/hooks/queries/useCreateApiKeyConnection';
import useProjectConnectors from '@/hooks/queries/useProjectConnectors';
import useUniqueMagicLink from '@/hooks/queries/useUniqueMagicLink';
Expand Down Expand Up @@ -419,7 +420,10 @@ const ProviderModal = () => {
<span className="text-sm">You've successfully connected your account!</span>
</div>
<button
onClick={() => CloseSuccessDialog(false)}
onClick={() => {
CloseSuccessDialog(false)
window.location.href = config.WEBAPP_URL;
}}
className="mt-4 px-6 py-2 bg-black text-white rounded-lg font-semibold hover:bg-gray-100 hover:text-black transition-colors"
>
Go to Dashboard
Expand Down
2 changes: 1 addition & 1 deletion apps/webapp/src/app/(Dashboard)/configuration/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export default function Page() {
{
loading: 'Updating...',
success: (data: any) => {
queryClient.setQueryData<any>(['pull-frequencies'], (oldData: any) => ({
queryClient.setQueryData<any>(['pull_frequencies'], (oldData: any) => ({
...oldData,
[vertical]: frequency.toString(),
}));
Expand Down
2 changes: 1 addition & 1 deletion apps/webapp/src/hooks/create/useCreatePullFrequency.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export type UpdatePullFrequencyData = Record<string, number>;

export const useUpdatePullFrequency = () => {
const add = async (data: UpdatePullFrequencyData) => {
const response = await fetch(`${config.API_URL}/sync/internal/pull-frequencies`, {
const response = await fetch(`${config.API_URL}/sync/internal/pull_frequencies`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down
4 changes: 2 additions & 2 deletions apps/webapp/src/hooks/get/useGetPullFrequencies.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import Cookies from 'js-cookie';

const usePullFrequencies = () => {
return useQuery({
queryKey: ['pull-frequencies'],
queryKey: ['pull_frequencies'],
queryFn: async (): Promise<PullFrequency> => {
const response = await fetch(`${config.API_URL}/sync/internal/pull-frequencies`,{
const response = await fetch(`${config.API_URL}/sync/internal/pull_frequencies`,{
method: 'GET',
headers: {
'Content-Type': 'application/json',
Expand Down
1 change: 1 addition & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ services:
context: ./
args:
VITE_BACKEND_DOMAIN: http://localhost:3000
VITE_WEBAPP_DOMAIN: http://localhost
restart: always
ports:
- 81:5173
Expand Down
1 change: 1 addition & 0 deletions docker-compose.source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ services:
context: ./
args:
VITE_BACKEND_DOMAIN: ${NEXT_PUBLIC_BACKEND_DOMAIN}
VITE_WEBAPP_DOMAIN: ${NEXT_PUBLIC_WEBAPP_DOMAIN}
restart: always
ports:
- 81:80
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ services:
condition: service_healthy
networks:
- backend
- frontend
- frontend

webapp-next:
image: panora.docker.scarf.sh/panoradotdev/frontend-webapp:selfhosted
Expand Down
2 changes: 1 addition & 1 deletion docs/api-reference/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "Authentication"
description: ""
---

The Panora API uses [API keys](/core-concepts/auth) to authenticate requests. You can view and manage your API keys in the [Panora Dashboard](https://dashboard.panora.dev/api-keys).
The Panora API uses [API keys](/core-concepts/auth) to authenticate requests. You can view and manage your API keys in the [Panora Dashboard](https://app.panora.dev/api-keys).

Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.

Expand Down
2 changes: 1 addition & 1 deletion docs/backend-sdk/python.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ poetry add panora-sdk
```
Instantiate the SDK:

<Tip>Go to your dashboard to get your [API Key](https://dashboard.panora.dev/api-keys)</Tip>
<Tip>Go to your dashboard to get your [API Key](https://app.panora.dev/api-keys)</Tip>

```python
import os
Expand Down
2 changes: 1 addition & 1 deletion docs/backend-sdk/typescript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npm i @panora/sdk

Instantiate the SDK:

<Tip>Go to your dashboard to get your [API Key](https://dashboard.panora.dev/api-keys)</Tip>
<Tip>Go to your dashboard to get your [API Key](https://app.panora.dev/api-keys)</Tip>

```javascript
import { Panora } from "@panora/sdk";
Expand Down
4 changes: 2 additions & 2 deletions docs/core-concepts/auth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Depending on your setup, you should make requests to one of those endpoints:


**Creating your API Key** <br/>
Go to your [dashboard](https://dashboard.panora.dev), and visit the _API Keys_ [section](https://dashboard.panora.dev/api-keys). Click the `Create New Key` button.
Go to your [dashboard](https://app.panora.dev), and visit the _API Keys_ [section](https://app.panora.dev/api-keys). Click the `Create New Key` button.
<Frame type="glass">
<img src="/images/api-keys.png" />
</Frame>
Expand Down Expand Up @@ -74,7 +74,7 @@ We also recommend practising by looking at the specific verticals you want to in

<Info>
You can find the Typescript SDK on NPM
[here](https://www.npmjs.com/package/@panora/sdk-typescript)
[here](https://www.npmjs.com/package/@panora/sdk)
</Info>
In this example, we will create a contact in a CRM. Visit other sections of the [documentation](/ticketing/overview) to find category-specific examples.
<CodeGroup>
Expand Down
2 changes: 1 addition & 1 deletion docs/core-concepts/custom-fields.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ You must have a connection, hence a valid linked user so you can create custom f
<Steps>

<Step title="Login to your Dashboard">
Login to your [account dashboard](https://dashboard.panora.dev) and click on _Configuration_ [section](https://dashboard.panora.dev/configuration) and go to tab **Field Mapping**.
Login to your [account dashboard](https://app.panora.dev) and click on _Configuration_ [section](https://app.panora.dev/configuration) and go to tab **Field Mapping**.
</Step>

<Step title="Define your custom field">
Expand Down
6 changes: 3 additions & 3 deletions docs/core-concepts/magic-links.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ icon: "wand-magic-sparkles"

<Steps>

<Step>Login to your [account dashboard](https://dashboard.panora.dev)</Step>
<Step>Login to your [account dashboard](https://app.panora.dev)</Step>

<Step>
Go to the _Connections_ [section](https://dashboard.panora.dev/connections)
Go to the _Connections_ [section](https://app.panora.dev/connections)
and click button `Create a Magic Link`
</Step>

Expand All @@ -39,5 +39,5 @@ icon: "wand-magic-sparkles"
<Step>Click `Generate`</Step>

</Steps>
<Info> You may see CLIENT_ID not found for some providers. It means we don't have an OAuth Panora App published yet so you may need to input your own credentials. (see this [guide](/recipes/add-custom-provider-creds))</Info>
<Note> You may see CLIENT_ID not found for some providers. It means we don't have an OAuth Panora App published yet so you may need to input your own credentials. (see this [guide](/recipes/add-custom-provider-creds))</Note>
Once the user successfully completes the granting auth flow, the connection will have a `status` value of `valid`.
24 changes: 23 additions & 1 deletion docs/core-concepts/sync-strategies.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,26 @@ Go to Configurations page, and apply the frequency to the category you wish to r

<Frame>
<img src="/images/frequency.png" alt="Description of image" />
</Frame>
</Frame>

**You can also the API, just select a number of seconds for the vertical you want to have custom sync.**
<CodeGroup>
```shell Curl
curl --request POST \
--url https://api.panora.dev/sync/pull_frequencies \
--header 'x-api-key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"crm": 300,
"hris": 0,
"ticketing": 0,
"accounting": 0,
"ats": 0,
"ecommerce": 0,
"hris": 0,
"filestorage": 0,
}'
```
</CodeGroup>

Here I just set up data to be synced every 5 minutes (300 seconds) for the CRM category.
22 changes: 16 additions & 6 deletions docs/quick-start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ icon: "star"

Before you begin, make sure you have the following:

- **Panora Running on your machine** (⏱️ 1 min self-hosting guide [here](/open-source/self_hosting/guide))
- **An account on [our cloud](https://app.panora.dev) (⏱️ 15sec)** or **Panora Running on your machine** (⏱️ 1 min self-hosting guide [here](/open-source/self_hosting/guide))
- **An API key** (⏱️ 1 min guide guide [here](/core-concepts/auth#learn-how-to-generate-your-api-keys))
- **A free Hubspot account** (signup [here](https://app.hubspot.com/signup-hubspot/crm) - use a [disposable email](https://temp-mail.org/en/) if you prefer)

Expand All @@ -23,9 +23,9 @@ Let's now create our first magic link!


<Steps>
<Step>Login to your [account dashboard](https://dashboard.panora.dev)</Step>
<Step>Login to your [account dashboard](https://app.panora.dev)</Step>
<Step>
Go to _Connections_ [section](https://dashboard.panora.dev/connections) and click button `Create a Magic Link`
Go to _Connections_ [section](https://app.panora.dev/connections) and click button `Create a Magic Link`
</Step>
<Step>Click `Create a Unique Magic Link`</Step>
<Step>
Expand All @@ -43,7 +43,7 @@ Let's now create our first magic link!
## Step 2: Grab the connection token

Connection tokens are the way Panora represents a third party's account, whatever the underlying identification mechanism is.
There are two ways to get these tokens: catchting them with a webhook, or just finding them in your dashboard. For now, we'll stick to the dashboard,.
There are two ways to get these tokens: [catching them with a webhook](/recipes/catch-connection-token), or just finding them in your dashboard. For now, we'll stick to the dashboard.

To find the `connection token` in the dashboard, visit the `connections` section. Copy the connection token from its column and save it.
![title](/images/connections_screen.png)
Expand All @@ -60,10 +60,20 @@ This will require you to have:
The API key identifies _YOU_ as a user of Panora, while the connection token identifies which user's account you behalf you want to. In the future, you will have one connection token per user account connected on the Panora platform, while keeping one API key.

You can copy past the Curl example below, and copy-paste it in your terminal. Don't forget to replace the API key and the connection token.

<Note>
ONLY SELFHOST:
Replace `https://api.panora.dev` with `http://localhost:3000`.
If you use the SDK, include `serverURL: 'http://localhost:3000'` in the Panora client
```javascript
const panora = new Panora({
serverURL: 'http://localhost:3000',
apiKey: process.env.API_KEY,
});
```
</Note>
<CodeGroup>
```shell curl
curl --location 'http://localhost:3000/crm/contacts' \
curl --location 'https://api.panora.dev/crm/contacts' \
--header 'x-connection-token: 7e6b9454-f616-477a-a71a-0f23eb74a72c' \
--header 'x-api-key: sk_dev_30a78556-6a83-425x-b461-a87f007a09e1'
```
Expand Down
11 changes: 10 additions & 1 deletion docs/rag/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@ Once we've synced documents across File Storage systems, we embed and chunk them
#### Use the SDK

<CodeGroup>
```javascript React
```shell Curl
curl --request GET \
--url https://api.panora.dev/rag/query \
--header 'x-api-key: <api-key>' \
--data '{
"query": "When does Panora incorporated?"
"topK": 3
}'
```
```javascript Typescript
import { Panora } from "@panora/sdk";
const panora = new Panora({
Expand Down
2 changes: 1 addition & 1 deletion docs/recipes/add-custom-provider-creds.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ With Custom OAuth, you can supply your own Client Id and Client Secret and Panor
inside your sofwtare's developer account.{" "}
</Note>

Visit the _Manage Connectors_ [section](https://dashboard.panora.dev/configuration), choose the connector you wish to add credentials for and add your own credentials.
Visit the _Manage Connectors_ [section](https://app.panora.dev/configuration), choose the connector you wish to add credentials for and add your own credentials.

<Frame type="glass">
<video
Expand Down
10 changes: 5 additions & 5 deletions docs/recipes/catch-connection-token.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ It is a field of the [Connection Object](/glossary/connection-object) that Panor
If you log `event.data`, you'll be able to check that it is a [Connection Object](/glossary/connection-object). Hence, it contains an `id_linked_user`(more info [here](/glossary/linked-account-object)) which is helpful to attach it to your own end-user on your backend/db systems.
</Step>
<Step title="Register your endpoint within Panora using the Dashboard or the API.">
Register the webhook endpoint’s accessible URL using the _Webhooks_ [section](https://dashboard.panora.dev/configuration) or the API so Panora knows where to deliver events.<br/>
Register the webhook endpoint’s accessible URL using the _Webhooks_ [section](https://app.panora.dev/configuration) or the API so Panora knows where to deliver events.<br/>
**Webhook URL format** <br/>
Expand All @@ -89,7 +89,7 @@ It is a field of the [Connection Object](/glossary/connection-object) that Panor
**Add a webhook endpoint** <br/>
Navigate to the _Configuration_ [section](https://dashboard.panora.dev/configuration) and head to the Webhooks tab. <br/>
Navigate to the _Configuration_ [section](https://app.panora.dev/configuration) and head to the Webhooks tab. <br/>
<video
controls
className="w-full aspect-video"
Expand All @@ -105,7 +105,7 @@ It is a field of the [Connection Object](/glossary/connection-object) that Panor
<CodeGroup>
```shell Curl
curl --request POST \
--url https://api.panora.dev/webhook \
--url https://api.panora.dev/webhooks \
--header 'x-api-key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
Expand Down Expand Up @@ -170,7 +170,7 @@ It is a field of the [Connection Object](/glossary/connection-object) that Panor
}
// Set your api key
// See your keys here: https://dashboard.panora.dev/api-keys
// See your keys here: https://app.panora.dev/api-keys
const panora = new Panora({ apiKey: process.env.API_KEY });
// Find your endpoint's secret in your webhook settings in the Config Page
Expand Down Expand Up @@ -240,7 +240,7 @@ It is a field of the [Connection Object](/glossary/connection-object) that Panor
from django.views.decorators.http import require_http_methods
# Set your api key
# See your keys here: https://dashboard.panora.dev/api-keys
# See your keys here: https://app.panora.dev/api-keys
panora = Panora(api_key=os.getenv("API_KEY", ""))
# Find your endpoint's secret in your webhook settings in the Config Page
Expand Down
2 changes: 1 addition & 1 deletion docs/recipes/embed-catalog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ Congrats ! You should be able to see the displayed connectors !
You have the ability to choose which connectors will be rendered (also applied to magic-link).
Go to _Manage Catalog Widget_ [section](https://dashboard.panora.dev/configuration), locate the connector you wish to add/remove and switch it on/off.
Go to _Manage Catalog Widget_ [section](https://app.panora.dev/configuration), locate the connector you wish to add/remove and switch it on/off.
12 changes: 6 additions & 6 deletions docs/recipes/import-existing-users.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,24 @@ These endpoint return [Linked Account object(s)](/glossary/linked-account-object
<CodeGroup>
```shell Import a single existing user
curl --request POST \
--url https://api.panora.dev/linked-users \
--url https://api.panora.dev/linked_users \
--header 'x-api-key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"linked_user_origin_id": "acme_user_1", # your remote id (id representing your existing user inside your system)
"alias": "acme", # your company name
"id_project": "ikloqqkq90-djsddhjs-prs12dj",
"id_project": "ikloqqkq90-djsddhjs-prs12dj"
}'
```
```shell Import a batch of existing users
curl --request POST \
--url https://api.panora.dev/linked-users/batch \
--url https://api.panora.dev/linked_users/batch \
--header 'x-api-key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"linked_user_origin_ids": ["acme_user_1", "acme_user_2", "acme_user_3"], # array of remote ids (ids representing your existing users inside your system)
"alias": "acme", # your company name
"id_project": "ikloqqkq90-djsddhjs-prs12dj",
"id_project": "ikloqqkq90-djsddhjs-prs12dj"
}'
```
</CodeGroup>
Expand All @@ -75,12 +75,12 @@ At any point in your code, if you have successfully added your linked users (see
<CodeGroup>
```shell linkedUserFromRemoteId
curl --request GET \
--url https://api.panora.dev/linked-users/fromRemoteId?remoteId=acme_id_1 \
--url https://api.panora.dev/linked_users/fromRemoteId?remoteId=acme_id_1 \
--header 'x-api-key: <api-key>' \
```
```shell fetchLinkedUsers
curl --request GET \
--url https://api.panora.dev/linked-users \
--url https://api.panora.dev/linked_users \
--header 'x-api-key: <api-key>' \
```
</CodeGroup>
Loading

0 comments on commit e33d874

Please sign in to comment.