-
Notifications
You must be signed in to change notification settings - Fork 0
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
BruceWouaigne
committed
Dec 18, 2024
1 parent
b4b6308
commit b8aaa96
Showing
1 changed file
with
71 additions
and
2 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 |
---|---|---|
@@ -1,2 +1,71 @@ | ||
# linkup-js-sdk | ||
A Javascript SDK for the Linkup API | ||
# π Linkup JS/TS SDK | ||
|
||
[![npm package](https://badge.fury.io/js/linkup-sdk.svg)](https://www.npmjs.com/package/linkup-sdk) | ||
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) | ||
|
||
A JS/TS SDK for the [Linkup API](https://linkup-api.readme.io/reference/getting-started), allowing | ||
easy integration with Linkup's services. π | ||
|
||
## π Features | ||
|
||
- β **Simple and intuitive API client.** | ||
- π **Supports both standard and deep search queries.** | ||
- π **Handles authentication and request management.** | ||
|
||
## π¦ Installation | ||
|
||
Simply install the Linkup JS SDK using `npm` or any other package manager: | ||
|
||
```bash | ||
npm i linkup-sdk | ||
``` | ||
|
||
## π οΈ Usage | ||
|
||
### Setting Up Your Environment | ||
|
||
#### 1. **π Obtain an API Key:** | ||
|
||
Sign up on [Linkup](https://app.linkup.so) to get your API key. | ||
|
||
#### 2. **βοΈ Set-up the API Key:** | ||
|
||
Pass the Linkup API key to the Linkup Client when creating it. | ||
|
||
```typescript | ||
import { LinkupClient } from 'linkup-sdk'; | ||
|
||
const client = new LinkupClient({ | ||
apiKey: '<YOUR API KEY>', | ||
}); | ||
``` | ||
|
||
### π Examples | ||
|
||
All search queries can be used with two very different modes: | ||
|
||
- with `standard` `depth`, the search will be straightforward and fast, suited for relatively simple | ||
queries (e.g. "What's the weather in Paris today?") | ||
- with `deep` `depth`, the search will use an agentic workflow, which makes it in general slower, | ||
but it will be able to solve more complex queries (e.g. "What is the company profile of LangChain | ||
accross the last few years, and how does it compare to its concurrents?") | ||
|
||
#### π Standard Search Query | ||
|
||
```typescript | ||
import { LinkupClient } from 'linkup-js-sdk'; | ||
|
||
const client = new LinkupClient({ | ||
apiKey: '<YOUR API KEY>', | ||
}); | ||
|
||
const askLinkup = async () => { | ||
return await client.search({ | ||
query: 'Can you tell me which women were awared the Physics Nobel Prize', | ||
depth: 'standard', | ||
outputType: 'sourcedAnswer', | ||
}); | ||
}; | ||
|
||
askLinkup().then(console.log); | ||
``` |