Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions proxies/mobile.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ const kernel = new Kernel();

const proxy = await kernel.proxies.create({
type: 'mobile',
name: 'my-tmobile-proxy',
config: {
carrier: 'tmobile'
}
name: 'mobile-proxy'
});

const browser = await kernel.browsers.create({
Expand All @@ -33,10 +30,7 @@ client = kernel.Kernel()

proxy = client.proxies.create(
type='mobile',
name='my-tmobile-proxy',
config={
'carrier': 'tmobile'
}
name='mobile-proxy'
)

browser = client.browsers.create(
Expand Down
23 changes: 9 additions & 14 deletions proxies/residential.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ const kernel = new Kernel();

const proxy = await kernel.proxies.create({
type: 'residential',
name: 'my-california-residential',
name: 'my-la-residential',
config: {
country: 'US',
city: 'sanfrancisco',
zip: '94102',
os: 'windows'
city: 'los_angeles'
}
});

Expand All @@ -36,12 +34,10 @@ client = kernel.Kernel()

proxy = client.proxies.create(
type='residential',
name='my-california-residential',
name='my-la-residential',
config={
'country': 'US',
'city': 'sanfrancisco',
'zip': '94102',
'os': 'windows'
'city': 'los_angeles'
}
)

Expand All @@ -54,9 +50,8 @@ browser = client.browsers.create(

## Configuration Parameters

- **`country`** - ISO 3166 country code
- **`state`** - Two-letter state code. Only supported for US and Australia. Cannot be used with `city`
- **`city`** - City name (lowercase, no spaces, e.g., `sanfrancisco`, `newyork`). Required if `zip` is provided
- **`zip`** - US ZIP code (5 digits). Requires `city` to be provided
- **`os`** - Operating system: `windows`, `macos`, or `android`
- **`asn`** - Autonomous System Number. Mutually exclusive with geo-location targeting
- **`country`** - ISO 3166 country code. Must be provided when providing other targeting options.
- **`state`** - Two-letter state code. Only supported for US.
- **`city`** - City name (lowercase, no spaces, e.g., `sanfrancisco`, `newyork`).
- **`zip`** - US ZIP code (5 digits). Conflicts with city and state.
- **`asn`** - Autonomous System Number. Conflicts with city and state.
23 changes: 23 additions & 0 deletions snippets/openapi/delete-extensions-id_or_name.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<CodeGroup>
```typescript Typescript/Javascript
import Kernel from '@onkernel/sdk';

const client = new Kernel({
apiKey: 'My API Key',
});

await client.extensions.delete('id_or_name');
```


```python Python
from kernel import Kernel

client = Kernel(
api_key="My API Key",
)
client.extensions.delete(
"id_or_name",
)
```
</CodeGroup>
31 changes: 31 additions & 0 deletions snippets/openapi/get-extensions-from_chrome_store.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<CodeGroup>
```typescript Typescript/Javascript
import Kernel from '@onkernel/sdk';

const client = new Kernel({
apiKey: 'My API Key',
});

const response = await client.extensions.downloadFromChromeStore({ url: 'url' });

console.log(response);

const content = await response.blob();
console.log(content);
```


```python Python
from kernel import Kernel

client = Kernel(
api_key="My API Key",
)
response = client.extensions.download_from_chrome_store(
url="url",
)
print(response)
content = response.read()
print(content)
```
</CodeGroup>
31 changes: 31 additions & 0 deletions snippets/openapi/get-extensions-id_or_name.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<CodeGroup>
```typescript Typescript/Javascript
import Kernel from '@onkernel/sdk';

const client = new Kernel({
apiKey: 'My API Key',
});

const response = await client.extensions.download('id_or_name');

console.log(response);

const content = await response.blob();
console.log(content);
```


```python Python
from kernel import Kernel

client = Kernel(
api_key="My API Key",
)
response = client.extensions.download(
"id_or_name",
)
print(response)
content = response.read()
print(content)
```
</CodeGroup>
24 changes: 24 additions & 0 deletions snippets/openapi/get-extensions.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<CodeGroup>
```typescript Typescript/Javascript
import Kernel from '@onkernel/sdk';

const client = new Kernel({
apiKey: 'My API Key',
});

const extensions = await client.extensions.list();

console.log(extensions);
```


```python Python
from kernel import Kernel

client = Kernel(
api_key="My API Key",
)
extensions = client.extensions.list()
print(extensions)
```
</CodeGroup>
29 changes: 29 additions & 0 deletions snippets/openapi/post-browsers-id-extensions.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<CodeGroup>
```typescript Typescript/Javascript
import Kernel from '@onkernel/sdk';

const client = new Kernel({
apiKey: 'My API Key',
});

await client.browsers.uploadExtensions('id', {
extensions: [{ name: 'name', zip_file: fs.createReadStream('path/to/file') }],
});
```


```python Python
from kernel import Kernel

client = Kernel(
api_key="My API Key",
)
client.browsers.upload_extensions(
id="id",
extensions=[{
"name": "name",
"zip_file": b"raw file contents",
}],
)
```
</CodeGroup>
26 changes: 26 additions & 0 deletions snippets/openapi/post-extensions.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<CodeGroup>
```typescript Typescript/Javascript
import Kernel from '@onkernel/sdk';

const client = new Kernel({
apiKey: 'My API Key',
});

const response = await client.extensions.upload({ file: fs.createReadStream('path/to/file') });

console.log(response.id);
```


```python Python
from kernel import Kernel

client = Kernel(
api_key="My API Key",
)
response = client.extensions.upload(
file=b"raw file contents",
)
print(response.id)
```
</CodeGroup>