Skip to content

Commit b44d3bd

Browse files
Merge pull request #76 from apivideo/docs/mobile_readme_upload_token_only
Docs/mobile readme upload token only
2 parents 99bccde + 599cedb commit b44d3bd

File tree

2 files changed

+17
-21
lines changed

2 files changed

+17
-21
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c2fec7ee1f9063f8d6a0b0e70054bcf32aa36ac56db9d158dc77cb34150c6c62
1+
032886cdfe39127b6fc7d3d9f5b3ca50c10d0be913d68ea0f1a9de1ff23d24b0

README.md

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![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)
22
![](https://github.com/apivideo/.github/blob/main/assets/apivideo_banner.png)
3-
<h1 align="center">api.video iOS uploader</h1>
3+
<h1 align="center">api.video Swift uploader</h1>
44

55
[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.
66

@@ -24,7 +24,7 @@
2424

2525
# Project description
2626

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

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

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

60-
// If you rather like to use the sandbox environment:
61-
// ApiVideoUploader.basePath = Environment.sandbox.rawValue
62-
// If you rather like to upload with your "YOUR_API_KEY" (upload)
63-
// ApiVideoUploader.apiKey = "YOUR_API_KEY"
64-
65-
try VideosAPI.uploadWithUploadToken(token: "MY_VIDEO_TOKEN", file: url) { video, error in
66-
if let video = video {
67-
// Manage upload with upload token success here
68-
}
69-
if let error = error {
70-
// Manage upload with upload token error here
71-
}
62+
try VideosAPI.uploadWithUploadToken(token: "MY_VIDEO_TOKEN", file: url) { video, error in
63+
if let video = video {
64+
// Manage upload with upload token success here
7265
}
73-
66+
if let error = error {
67+
// Manage upload with upload token error here
68+
}
69+
}
7470
```
7571

7672
# Documentation
@@ -118,14 +114,14 @@ Method | HTTP request | Description
118114
### API key
119115

120116
Most endpoints required to be authenticated using the API key mechanism described in our [documentation](https://docs.api.video/reference#authentication).
121-
The access token generation mechanism is automatically handled by the client. All you have to do is provide an API key:
122-
```swift
123-
ApiVideoUploader.apiKey = YOUR_API_KEY
124-
```
117+
118+
You must NOT store your API key in your application code to prevent your API key from being exposed in your source code.
119+
Only the [Public endpoints](#public-endpoints) can be called without authentication.
120+
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.
125121

126122
### Public endpoints
127123

128-
Some endpoints don't require authentication. These one can be called without setting `ApiVideoUploader.apiKey`:
124+
Some endpoints don't require authentication. These one can be called without setting `ApiVideoUploader.apiKey`.
129125

130126
## Have you gotten use from this API client?
131127

0 commit comments

Comments
 (0)