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 85f013f commit 0938af1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 28 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
38 changes: 11 additions & 27 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-client?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 client</h1>
<h1 align="center">api.video Swift client</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 Down Expand Up @@ -31,7 +31,7 @@
- [Contribution](#contribution)

# Project description
api.video's iOS streamlines the coding process. Chunking files is handled for you, as is pagination and refreshing your tokens.
api.video's Swift for iOS, macOS and tvOS streamlines the coding process. Chunking files is handled for you, as is pagination and refreshing your tokens.

# Getting started

Expand Down Expand Up @@ -59,30 +59,15 @@ Please follow the [installation](#installation) instruction and execute the foll
```swift
import ApiVideoClient

ApiVideoClient.apiKey = "YOUR_API_KEY"
// if you rather like to use the sandbox environment:
// ApiVideoClient.basePath = Environment.sandbox.rawValue
// If you rather like to use the sandbox environment:
// ApiVideoClient.basePath = Environment.sandbox.rawValue

let url = URL(string: "My video.mov")

VideosAPI.create(videoCreationPayload: VideoCreationPayload(title: "my video")) { video, error in
try VideosAPI.uploadWithUploadToken(token: "MY_VIDEO_TOKEN", file: url) { video, error in
if let video = video {
do {
try VideosAPI.upload(videoId: video.videoId,
file: url) { video, error in
if let video = video {
// Manage upload success here
}
if let error = error {
// Manage upload error here
}
}
} catch {
// Manage error on file here
}
// Manage upload with upload token success here
}
if let error = error {
// Manage create error here
// Manage upload with upload token error here
}
}
```
Expand Down Expand Up @@ -347,14 +332,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
ApiVideoClient.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 `ApiVideoClient.apiKey`:
Some endpoints don't require authentication. These one can be called without setting `ApiVideoClient.apiKey`.

## Have you gotten use from this API client?

Expand Down

0 comments on commit 0938af1

Please sign in to comment.