Contents

kurozora/kurozorakit

[KurozoraKit](https://developer.kurozora.app/kurozorakit) lets users manage their anime, manga, games and music library and access many other services from your app. When users provide permission to access their Kurozora account, they can use your app to share anime, add it to th

Swift Package Manager

KurozoraKit is 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

Or add it to your Package.swift:

dependencies: [
    .package(url: "https://github.com/Kurozora/KurozoraKit.git", from: "2.0.0")
]

Usage

KurozoraKit can be implemented using one line.

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 KKServices.
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:

do {
    let response = try await kurozoraKit.getExplore()
    // Handle response...
} catch {
    // Handle error...
}

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

License

KurozoraKit is an Open Source project covered by the MIT License.

Package Metadata

Repository: kurozora/kurozorakit

Default branch: master

README: README.md