The magic behind Kurozora app
KurozoraKit
KurozoraKit lets users manage their anime library and access many other serices from your app. When users provide permission to access their Kurozora account, they can use your app to share anime, add anime to their library, and discover any of the millions of anime in the Kurozora catalog. If your app detects that the user is not yet a Kurozora member, you can offer them to create an account within your app.
KurozoraKit is designed to be:
🛠 Intuitive: KurozoraKit is built with Swift, one of the fast, modern, safe and interactive programming languages.
🧵 Asynchronous: By utilizing the power of Swift Concurrency, KurozoraKit is more readable and less prone to errors like data races and deadlocks by design.
✨ Magical: The kit is carefully designed to work as efficient and reliable as you would expect it to.
📚 Documented: With up to 100% documentation coverage.
⚙️ Reliable: Built for the best API. The way KurozoraKit works together with the Kurozora API is truly otherworldly.
Requirements
KurozoraKit has been tested to work on iOS 15.0+ and macOS 12+. It also works best with Swift 5.0+
To use KurozoraKit in your project, you need to install it first.
Installation
CocoaPods
KurozoraKit is available through CocoaPods. To install it, simply add the following line to your Podfile
:
pod 'KurozoraKit'
Swift Package Manager
KurozoraKit is also available through Swift Package Manager. To install it, simply add the package through Xcode. Go to File > Add Package Dependencies...
and enter the following URL:
https://github.com/Kurozora/KurozoraKit.git
Alternatively you can add the following line to your Package.swift
file:
dependencies: [
.package(url: "https://github.com/Kurozora/KurozoraKit.git", from: "1.0.0")
]
Usage
KurozoraKit can be implemented using one line in the global
scope.
let kurozoraKit = KurozoraKit()
KurozoraKit allows you to set your own API endpoint. For example, if you have a custom API endpoint for debugging purposes, you can set it like this:
let kurozoraKit = KurozoraKit(apiEndpoint: .custom("https://kurozora.debug/api/"))
KurozoraKit also accepts a KKServices
object to enable and manage extra functionality. For example to manage Keychain data you can do something like the following:
// Prepare Keychain with your desired setting.
let appIdentifierPrefix = Bundle.main.infoDictionary?["AppIdentifierPrefix"] as! String
let keychain = Keychain(service: "AppName", accessGroup: "\(appIdentifierPrefix)com.company.shared").synchronizable(true).accessibility(.afterFirstUnlock)
// Pass the keychain object.
let services = KKServices(keychain: keychain)
// Pass KKService
let kurozoraKit = KurozoraKit(authenticationKey: "bearer-token").services(services)
You can also be chain desired methods instead of passing data as parameter.
let services = KKServices().keychainDefaults(keychain)
let kurozoraKit = KurozoraKit()
.authenticationKey("bearer-token")
.services(services)
After setting up KurozoraKit you can use an API by calling its own method. For example, to get the explore page data, you do the following:
let genreID = 1
kurozoraKit.getExplore(genreID) { result in
switch result {
case .success(let success):
// Handle success case…
case .failure(let error):
// Handle error case…
}
}
Contributing
Read the Contributing Guide to learn about reporting issues, contributing code, and more ways to contribute.
Security
Read our Security Policy to learn about reporting security issues.
Getting in Touch
If you have any questions or just want to say hi, join the Kurozora Discord and drop a message on the #development channel.
Code of Conduct
This project has a Code of Conduct. By interacting with this repository, or community you agree to abide by its terms.
More by Kurozora
- Kurozora Android App — Android client app
- Kurozora Discord Bot — A versatile Discord bot with access to Kurozora services
- Kurozora iOS App — iOS/iPadOS/MacOS client app
- Kurozora Linux App — Linux client app
- Kurozora Web — Home to the Kurozora website and API
- Kurozora Web Extension — Anime, Manga and Game search engine for FireFox and Chrome
License
KurozoraKit is an Open Source project covered by the MIT License.