Skip to content

Commit

Permalink
Merge pull request #189 from panoratech/annotate-docs-crmcontact
Browse files Browse the repository at this point in the history
Annotate docs crmcontact
  • Loading branch information
rflihxyz authored Dec 21, 2023
2 parents eefe299 + 022aa38 commit dd20e5f
Show file tree
Hide file tree
Showing 6 changed files with 182 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,17 @@ export function FModal({ onClose }: {onClose: () => void}) {
return (
<Tabs defaultValue="define" className="w-[400px] mt-5">
<TabsList className="grid w-full grid-cols-2">
<TabsTrigger value="define">Define Fields</TabsTrigger>
<TabsTrigger value="define">Define Panora Custom Fields</TabsTrigger>
<TabsTrigger value="map">Map Fields</TabsTrigger>
</TabsList>
<TabsContent value="define">
<Card>
<Form {...defineForm}>
<form onSubmit={defineForm.handleSubmit(onDefineSubmit)}>
<CardHeader>
<CardTitle>Define</CardTitle>
<CardTitle>Define Panora Field</CardTitle>
<CardDescription>
Define a custom field you want to enable on unified models. It must be mapped to an existent custom field on your end-user's provider.
Define a Panora custom field to extend a unified model. Once done, you can map it to an existing field in your end-user's software.
</CardDescription>
</CardHeader>
<CardContent className="space-y-2">
Expand All @@ -160,11 +160,11 @@ export function FModal({ onClose }: {onClose: () => void}) {
name="standardModel"
render={({ field }) => (
<FormItem>
<FormLabel>Standard Model</FormLabel>
<FormLabel>Standard Object</FormLabel>
<FormControl>
<Select onValueChange={field.onChange} defaultValue={field.value} >
<SelectTrigger className="w-[180px]">
<SelectValue placeholder="Select a model" />
<SelectValue placeholder="Select an object" />
</SelectTrigger>
<SelectContent>
<SelectGroup>
Expand Down Expand Up @@ -198,7 +198,7 @@ export function FModal({ onClose }: {onClose: () => void}) {
/>
</FormControl>
<FormDescription>
This is the custom name of the field.
This will be the name of the field on Panora's side.
</FormDescription>
<FormMessage />
</FormItem>
Expand All @@ -211,14 +211,14 @@ export function FModal({ onClose }: {onClose: () => void}) {
name="fieldDescription"
render={({ field }) => (
<FormItem>
<FormLabel>Description</FormLabel>
<FormLabel>Short Description</FormLabel>
<FormControl>
<Input
placeholder="favorite color" {...field}
placeholder="My customer's favorite color" {...field}
/>
</FormControl>
<FormDescription>
This is the description of the field.
A quick description of the field to remind you its context.
</FormDescription>
<FormMessage />
</FormItem>
Expand Down Expand Up @@ -274,7 +274,7 @@ export function FModal({ onClose }: {onClose: () => void}) {
<CardHeader>
<CardTitle>Map</CardTitle>
<CardDescription>
Now that you defined your field, map it to an existent custom field on your end-user's tool.
After you defined a Panora custom field, you can map it to an existent custom field on your end-user's software.
</CardDescription>
</CardHeader>
<CardContent className="space-y-2">
Expand All @@ -284,7 +284,7 @@ export function FModal({ onClose }: {onClose: () => void}) {
name="attributeId"
render={({ field }) => (
<FormItem>
<FormLabel>Field</FormLabel>
<FormLabel>Panora Field</FormLabel>
<FormControl>
<Select
onValueChange={field.onChange} defaultValue={field.value}
Expand Down Expand Up @@ -404,7 +404,7 @@ export function FModal({ onClose }: {onClose: () => void}) {
</Select>
</FormControl>
<FormDescription>
This is the source provider's field name.
These are all the fields we found in your customer's software.
</FormDescription>
<FormMessage />
</FormItem>
Expand Down
2 changes: 1 addition & 1 deletion apps/webapp/src/components/connections/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function ConnectionsPage() {
<div className="flex-1 space-y-4 p-8 pt-6">
<div className="flex flex-col items-start justify-between space-y-2">
<h2 className="text-3xl font-bold tracking-tight">Connections</h2>
<h2 className="text-lg font-bold tracking-tight">Integrations between your users’ accounts and third-party apps.</h2>
<h2 className="text-lg font-bold tracking-tight">Connections between your product and your users’ accounts on third-party software.</h2>
</div>
<ConnectionTable/>
</div>
Expand Down
86 changes: 84 additions & 2 deletions docs/backend-sdk/java.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,86 @@
---
title: 'Java SDK'
title: 'Java'
description: 'Introduction to our Java SDK'
---
---
## Requirements

- Java 8
- Maven

## Installation

If you use Maven, place the following within the `<dependencies>` tag in your pom.xml file:

```XML
<dependency>
<groupId>dev.panora</groupId>
<artifactId>panora-sdk</artifactId>
<version>0.0.1</version>
</dependency>
```

If you use Gradle, paste the next line inside the dependencies block of your build.gradle file:

```Gradle
implementation group: "dev.panora", name: "PanoraSDK", version: "0.0.1"
```

## Authentication

To see whether an endpoint needs a specific type of authentication check the endpoint's documentation.

### Bearer Authentication
The PanoraSDK API uses bearer tokens as a form of authentication. You can set the bearer token when initializing the SDK through the constructor:
```Java
PanoraSDK sdk = new PanoraSDK("YOUR_BEARER_TOKEN");
```

Or through the `setBearerToken` method:
```Java
PanoraSDK sdk = new PanoraSDK();
sdk.setBearerToken("YOUR_BEARER_TOKEN");
```


### List all connections to your app

```java
package dev.panora.examples;

import dev.panora.PanoraSDK;
import dev.panora.exceptions.ApiException;

public class Main {

public static void main(String[] args) {
PanoraSDK client = new PanoraSDK(System.getenv("PANORASDK_BEARER_TOKEN"));
try {
Object response = client.connectionsService.getConnections();
System.out.println(response);
} catch (ApiException e) {
e.printStackTrace();
}
}
}

```

This will list all the connections available, across all users. You should get an object similar to this one below. [Read more about the `connection` object.](/connections/overview)
```json
{
"id_connection": "6cd057cb-39df-44ce-9be8-ax9d167c3940",
"status": "valid",
"provider_slug": "hubspot",
"account_url": null,
"token_type": "oauth",
"access_token": "904570287538dddf72fd821e4d5cec51:66266ee62310752d4a243c12b133656edd5af42947a832f4439c710334e045e59782107d40e856c27e813b7a6ed068100376b3ff83d1c8237330ba034605dd846650524e6fcfb708e3f62b1401d8a0dc3d90022cdf9ad1c76fc9209f3a5d153f6e33bbb8f6642600a6c9a098e81fb1e2da0fdff0455b7823519fba195b5065b4319a314013e22f934c80e4f60bec4385989c92c2dd9036d19f720e85b10325c42dc8a035c363e279af0e4ab2c4cd016051c5b32bf6009bf0df0aa8565d048856",
"refresh_token": "904570287538dddf72fd821e4d5cec51:58d9c1492b908caef83885b467d1ab1ea9fc6994a59ed4392edbb5365b89a02a8a4995347d8ec37037192a96856e2c24",
"expiration_timestamp": "2023-12-20T18:44:44.869Z",
"created_at": "2023-12-10T18:20:06.275Z",
"id_project": "801f9ede-c698-4e66-a7fc-48d19eebaa4f",
"id_linked_user": "d7a0af02-0f9b-40a6-86a9-612dcfe341fe"
}
```



62 changes: 60 additions & 2 deletions docs/backend-sdk/python.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,62 @@
---
title: 'Python SDK'
title: 'Python'
description: 'Introduction to our Python SDK'
---
---

## Installing & instantiating the Python SDK
Install it with your favorite package manager, e.g.:

```bash
pip install panorasdk
```

Instantiate the SDK:
<Tip>
Go to your dashboard to get your API Key
</Tip>

```python
sdk = PanoraSDK('YOUR_BEARER_TOKEN')
```
Or through the `set_access_token` method:
```python
sdk = PanoraSDK()
sdk.set_access_token('YOUR_BEARER_TOKEN')
```
You can also set it for each service individually:
```python
sdk = PanoraSDK()
sdk.main.set_access_token('YOUR_BEARER_TOKEN')
```

### List all connections to your app

```python
from os import getenv
from pprint import pprint
from panorasdk import PanoraSDK
sdk = PanoraSDK()
sdk.set_access_token(getenv("PANORASDK_ACCESS_TOKEN"))
results = sdk.connections.get_connections()

pprint(vars(results))
```

This will list all the connections available, across all users. You should get an object similar to this one below. [Read more about the `connection` object.](/connections/overview)
```json
{
"id_connection": "6cd057cb-39df-44ce-9be8-ax9d167c3940",
"status": "valid",
"provider_slug": "hubspot",
"account_url": null,
"token_type": "oauth",
"access_token": "904570287538dddf72fd821e4d5cec51:66266ee62310752d4a243c12b133656edd5af42947a832f4439c710334e045e59782107d40e856c27e813b7a6ed068100376b3ff83d1c8237330ba034605dd846650524e6fcfb708e3f62b1401d8a0dc3d90022cdf9ad1c76fc9209f3a5d153f6e33bbb8f6642600a6c9a098e81fb1e2da0fdff0455b7823519fba195b5065b4319a314013e22f934c80e4f60bec4385989c92c2dd9036d19f720e85b10325c42dc8a035c363e279af0e4ab2c4cd016051c5b32bf6009bf0df0aa8565d048856",
"refresh_token": "904570287538dddf72fd821e4d5cec51:58d9c1492b908caef83885b467d1ab1ea9fc6994a59ed4392edbb5365b89a02a8a4995347d8ec37037192a96856e2c24",
"expiration_timestamp": "2023-12-20T18:44:44.869Z",
"created_at": "2023-12-10T18:20:06.275Z",
"id_project": "801f9ede-c698-4e66-a7fc-48d19eebaa4f",
"id_linked_user": "d7a0af02-0f9b-40a6-86a9-612dcfe341fe"
}
```


19 changes: 10 additions & 9 deletions docs/backend-sdk/typescript.mdx
Original file line number Diff line number Diff line change
@@ -1,42 +1,41 @@
---
title: 'TypeScript SDK'
title: 'TypeScript'
description: 'Introduction to our Typescript SDK'
---


# Installing & instantiating the Typescript SDK
## Installing & instantiating the Typescript SDK
Install it with your favorite package manager, e.g.:

```bash
npm i @panora/typescript-sdk
```

Instantiate the SDK:
<Tip>
Go to your dashboard to get your API Key
</Tip>

```javascript
import { PanoraSDK } from '@panora/typescript-sdk';

const sdk = new PanoraSDK('YOUR_API_KEY');
```

<Tip>
Visit your dashboard to create an API Key
</Tip>

### List all connections to your app
### List all connections to your app

```javascript
import { PanoraSDK } from '@panora/typescript-sdk';

const sdk = new PanoraSDK('process.env.PANORA_API_KEY');
const sdk = new PanoraSDK('YOUR_API_KEY');

(async () => {
const result = await sdk.connections.getConnections();
console.log(result);
})();
```

This will list all the connections available, across all users.
This will list all the connections available, across all users. You should get an object similar to this one below. [Read more about the `connection` object.](/connections/overview)
```json
{
"id_connection": "6cd057cb-39df-44ce-9be8-ax9d167c3940",
Expand All @@ -52,3 +51,5 @@ This will list all the connections available, across all users.
"id_linked_user": "d7a0af02-0f9b-40a6-86a9-612dcfe341fe"
}
```


23 changes: 15 additions & 8 deletions docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@
"name": "Webhooks",
"url": "webhooks"
},

{
"name": "SDKs",
"url": "backend-sdk"
}
,
{
"name": "API Reference",
"url": "api-reference"
Expand Down Expand Up @@ -219,6 +225,15 @@
]
}
]
},

{
"group": "Backend SDKs",
"pages": [
"backend-sdk/typescript",
"backend-sdk/python",
"backend-sdk/java"
]
}
,
{
Expand All @@ -234,14 +249,6 @@
"features/magic-links",
"features/custom-fields"
]
},
{
"group": "Backend SDKs",
"pages": [
"backend-sdk/typescript",
"backend-sdk/python",
"backend-sdk/java"
]
}
,
{
Expand Down

0 comments on commit dd20e5f

Please sign in to comment.