https://github.com/brightdigit/ngrokit
Swift API for Ngrok Agent API.
https://github.com/brightdigit/ngrokit
ngrok ngrok-client swift
Last synced: about 2 months ago
JSON representation
Swift API for Ngrok Agent API.
- Host: GitHub
- URL: https://github.com/brightdigit/ngrokit
- Owner: brightdigit
- License: mit
- Created: 2024-08-21T18:31:57.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-17T12:17:11.000Z (about 1 year ago)
- Last Synced: 2025-08-18T17:58:31.798Z (about 2 months ago)
- Topics: ngrok, ngrok-client, swift
- Language: Swift
- Homepage:
- Size: 43 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ngrokit
Swift API for [Ngrok Agent API](https://ngrok.com/docs/agent/api/).
[](https://swiftpackageindex.com/brightdigit/Ngrokit/documentation)
[](https://swift.org)
[](http://twitter.com/brightdigit)


[](https://swiftpackageindex.com/brightdigit/Ngrokit)
[](https://swiftpackageindex.com/brightdigit/Ngrokit)[](https://codecov.io/gh/brightdigit/Ngrokit)
[](https://www.codefactor.io/repository/github/brightdigit/Ngrokit)
[](https://codebeat.co/projects/github-com-brightdigit-Ngrokit-main)
[](https://codeclimate.com/github/brightdigit/Ngrokit)
[](https://codeclimate.com/github/brightdigit/Ngrokit)
[](https://codeclimate.com/github/brightdigit/Ngrokit)# Table of Contents
* [Requirements](#requirements)
* [Installation](#installation)
* [Usage](#usage)
* [Connecting to the Local REST API](#connecting-to-the-local-rest-api)
* [Starting the CLI Process](#starting-the-cli-process)
* [Documentation](#documentation)
* [License](#license)# Requirements
**Apple Platforms**
- Xcode 16.0 or later
- Swift 6.0 or later
- iOS 17 / watchOS 10.0 / tvOS 17 / macOS 14 or later deployment targets**Linux**
- Ubuntu 20.04 or later
- Swift 6.0 or later# Installation
To integrate **Ngrokit** into your app using SPM, specify it in your Package.swift file:
```swift
let package = Package(
...
dependencies: [
.package(url: "https://github.com/brightdigit/Ngrokit.git", from: "1.0.0")
],
targets: [
.target(
name: "YourServerApp",
dependencies: [
.product(name: "Ngrokit", package: "Ngrokit"), ...
]),
...
]
)
```# Usage
Ngrokit is an easy to use Swift library for call the local Ngrok API as well as running the `ngrok` command.
### Connecting to the Local REST API
Using the `NgrokClient` to connect to your local development server:
```swift
let client = NgrokClient(transport: URLSession.shared)
```For using different transports see the client list at the [Swift OpenAPI Generator](https://github.com/apple/swift-openapi-generator?tab=readme-ov-file#package-ecosystem).
### Starting the CLI Process
Start the CLI process by using `NgrokProcessCLIAPI`:
```swift
let cliAPI = NgrokProcessCLIAPI(ngrokPath: "/usr/local/bin/ngrok")
let process = api.process(forHTTPPort: 100)
process.run { let error in
print(error)
}
```## Documentation
To learn more, check out the full [documentation](https://swiftpackageindex.com/brightdigit/Ngrokit/documentation).
# License
This code is distributed under the MIT license. See the [LICENSE](https://github.com/brightdigit/Ngrokit/LICENSE) file for more info.