Skip to content

Commit

Permalink
Docs/mobile readme upload token only
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaultBee authored Oct 23, 2023
1 parent 99bccde commit 12ccda9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .openapi-generator/oas_apivideo.yaml-defaut-cli.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c2fec7ee1f9063f8d6a0b0e70054bcf32aa36ac56db9d158dc77cb34150c6c62
032886cdfe39127b6fc7d3d9f5b3ca50c10d0be913d68ea0f1a9de1ff23d24b0
35 changes: 15 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![badge](https://img.shields.io/twitter/follow/api_video?style=social)](https://twitter.com/intent/follow?screen_name=api_video)   [![badge](https://img.shields.io/github/stars/apivideo/api.video-swift-uploader?style=social)]()   [![badge](https://img.shields.io/discourse/topics?server=https%3A%2F%2Fcommunity.api.video)](https://community.api.video)
![](https://github.com/apivideo/.github/blob/main/assets/apivideo_banner.png)
<h1 align="center">api.video iOS uploader</h1>
<h1 align="center">api.video Swift uploader</h1>

[api.video](https://api.video) is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in your app.

Expand All @@ -24,7 +24,7 @@

# Project description

api.video's iOS uploads videos to api.video using delegated upload token or API Key.
api.video's Swift for iOS, macOS and tvOS uploads videos to api.video using delegated upload token or API Key.

It allows you to upload videos in two ways:
- standard upload: to send a whole video file in one go
Expand Down Expand Up @@ -56,21 +56,17 @@ Please follow the [installation](#installation) instruction and execute the foll
```swift
import ApiVideoUploader

// If you rather like to use the sandbox environment:
// ApiVideoUploader.basePath = Environment.sandbox.rawValue

// If you rather like to use the sandbox environment:
// ApiVideoUploader.basePath = Environment.sandbox.rawValue
// If you rather like to upload with your "YOUR_API_KEY" (upload)
// ApiVideoUploader.apiKey = "YOUR_API_KEY"

try VideosAPI.uploadWithUploadToken(token: "MY_VIDEO_TOKEN", file: url) { video, error in
if let video = video {
// Manage upload with upload token success here
}
if let error = error {
// Manage upload with upload token error here
}
try VideosAPI.uploadWithUploadToken(token: "MY_VIDEO_TOKEN", file: url) { video, error in
if let video = video {
// Manage upload with upload token success here
}

if let error = error {
// Manage upload with upload token error here
}
}
```

# Documentation
Expand Down Expand Up @@ -118,14 +114,13 @@ Method | HTTP request | Description
### API key

Most endpoints required to be authenticated using the API key mechanism described in our [documentation](https://docs.api.video/reference#authentication).
The access token generation mechanism is automatically handled by the client. All you have to do is provide an API key:
```swift
ApiVideoUploader.apiKey = YOUR_API_KEY
```
You must NOT store your API key in your application code to prevent your API key from being exposed in your source code.
Only the [Public endpoints](#public-endpoints) can be called without authentication.
In the case, you want to call an endpoint that requires authentication, you will have to use a backend server. See [Security best practices](https://docs.api.video/sdks/security) for more details.

### Public endpoints

Some endpoints don't require authentication. These one can be called without setting `ApiVideoUploader.apiKey`:
Some endpoints don't require authentication. These one can be called without setting `ApiVideoUploader.apiKey`.

## Have you gotten use from this API client?

Expand Down

0 comments on commit 12ccda9

Please sign in to comment.