-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/mit-27/Panora into github-c…
…onnector
- Loading branch information
Showing
613 changed files
with
7,419 additions
and
23,922 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,17 @@ | ||
name: Upload OpenAPI spec to Stainless | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
stainless: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: stainless-api/upload-openapi-spec-action@main | ||
with: | ||
stainless_api_key: ${{ secrets.STAINLESS_API_KEY }} | ||
input_path: 'packages/api/swagger/swagger-spec.yaml' | ||
project_name: 'panora2' |
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
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 |
---|---|---|
@@ -1,5 +1,11 @@ | ||
# @panora/embedded-card-react | ||
|
||
## 1.3.1 | ||
|
||
### Patch Changes | ||
|
||
- ded2580: Readme patch | ||
|
||
## 1.3.0 | ||
|
||
### Minor Changes | ||
|
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
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
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 |
---|---|---|
@@ -1,5 +1,11 @@ | ||
# @panora/frontend-sdk | ||
|
||
## 1.1.1 | ||
|
||
### Patch Changes | ||
|
||
- ded2580: Readme patch | ||
|
||
## 1.1.0 | ||
|
||
### Minor Changes | ||
|
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,75 @@ | ||
|
||
## Frontend SDK (React) | ||
|
||
It is a React component aimed to be used in any of your pages so end-users can connect their 3rd parties in 1-click! | ||
|
||
## Installation | ||
|
||
```bash | ||
npm i @panora/frontend-sdk | ||
``` | ||
|
||
or | ||
|
||
```bash | ||
pnpm i @panora/frontend-sdk | ||
``` | ||
|
||
or | ||
|
||
```bash | ||
yarn add @panora/frontend-sdk | ||
``` | ||
|
||
## Use the component | ||
|
||
```ts | ||
import { ConnectorCategory } from '@panora/shared' | ||
import Panora from '@panora/frontend-sdk' | ||
|
||
const panora = new Panora({ apiKey: 'YOUR_PRIVATE_API_KEY' }); | ||
|
||
// kickstart the connection (OAuth, ApiKey, Basic) | ||
panora.connect({ | ||
providerName: "hubspot", | ||
vertical: ConnectorCategory.Crm, | ||
linkedUserId: "4c6ca51b-7b23-4e3a-9309-24d2d331a04d", | ||
}) | ||
``` | ||
|
||
```ts | ||
The Panora SDK must be instantiated with this type: | ||
|
||
interface PanoraConfig { | ||
apiKey: string; | ||
overrideApiUrl: string; | ||
// Optional (only if you are in selfhost mode and want to use localhost:3000), by default: api.panora.dev | ||
} | ||
|
||
The .connect() function takes this type: | ||
|
||
interface ConnectOptions { | ||
providerName: string; | ||
vertical: ConnectorCategory; // Must be imported from @panora/shared | ||
linkedUserId: string; // You can copy it from your Panora dahsbord under /configuration tab | ||
credentials?: Credentials; // Optional if you try to use OAuth | ||
options?: { | ||
onSuccess?: () => void; | ||
onError?: (error: Error) => void; | ||
overrideReturnUrl?: string; | ||
} | ||
} | ||
|
||
By default, for OAuth we use Panora managed OAuth apps but if we dont have one registered OR you want to use your own, you must register that under /configuration tab from the webapp and it will automatically use these custom credentials ! | ||
|
||
interface Credentials { | ||
username?: string; // Used for Basic Auth | ||
password?: string; // Used for Basic Auth | ||
apiKey?: string; // Used for Api Key Auth | ||
} | ||
|
||
For Basic Auth some providers may only ask for username or password. | ||
|
||
In this case just specify either password or username depending on the 3rd party reference. | ||
|
||
``` |
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
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
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
22 changes: 14 additions & 8 deletions
22
apps/magic-link/src/hooks/queries/useProjectConnectors.tsx
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 |
---|---|---|
@@ -1,16 +1,22 @@ | ||
import { useQuery } from '@tanstack/react-query'; | ||
import config from '@/helpers/config'; | ||
|
||
const useProjectConnectors = (id: string) => { | ||
const useProjectConnectors = (id: string | null) => { | ||
return useQuery({ | ||
queryKey: ['project-connectors', id], | ||
queryKey: ['project-connectors', id], | ||
queryFn: async (): Promise<any> => { | ||
if (!id) { | ||
throw new Error('Project ID is not available'); | ||
} | ||
const response = await fetch(`${config.API_URL}/project-connectors?projectId=${id}`); | ||
if (!response.ok) { | ||
throw new Error('Network response was not ok'); | ||
} | ||
return response.json(); | ||
} | ||
if (!response.ok) { | ||
throw new Error('Network response was not ok'); | ||
} | ||
return response.json(); | ||
}, | ||
enabled: !!id, // Only run the query if id is truthy | ||
retry: false, // Don't retry if the project ID is not available | ||
}); | ||
}; | ||
export default useProjectConnectors; | ||
|
||
export default useProjectConnectors; |
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
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
Oops, something went wrong.