# Novu Kotlin SDK
[![License](https://poser.pugx.org/unicodeveloper/novu/license.svg)](LICENSE.md)
[![GitHub release (with filter)](https://img.shields.io/github/v/release/novuhq/novu-kotlin?label=SDK&link=https%3A%2F%2Fgithub.com%2Fnovuhq%2Fnovu-kotlin%2Freleases%2Flatest)](https://github.com/novuhq/novu-kotlin/releases/latest)
The [Novu Kotlin](https://novu.co) SDK provides a fluent and expressive interface for interacting with [Novu's API](https://docs.novu.co/api-reference/overview) and managing notifications. Please refer to the full [documentation](https://docs.novu.co/docs/overview/introduction) to learn more.
## Installation
**Maven users:**
```xml
co.novu
novu-kotlin
1.2.0
```
**Gradle users:**
```kotlin
//Kotlin
//add dependency
implementation("co.novu:novu-kotlin:1.2.0")
```
```groovy
//Groovy
//add dependency
implementation 'co.novu:novu-kotlin:1.2.0'
```
Sync your project, and you should have the artifacts downloaded.
## Usage
To use the library, first initialize the client with your API token:
```kotlin
// without changing the backend URL
import co.novu.Novu
import co.novu.extensions.environments
fun main() {
val novu = Novu(apiKey = "API_KEY")
val environment = novu.environments()
println(environment)
}
```
```kotlin
// with config param
import co.novu.Novu
import co.novu.NovuConfig
import co.novu.extensions.environments
fun main() {
val config = NovuConfig(backendUrl = "URL", apiKey = "API_KEY")
val novu = Novu(config)
val environment = novu.environments()
println(environment)
}
```
You can then call methods on the client to interact with the Novu API:
```kotlin
novu.subscribers()
```
## List of all methods
The client methods map directly to the Novu API endpoints. Here is a list of all the available methods. Check [the API docs](https://docs.novu.co/api-reference/overview) for list of available `methods`.
### Changes
- `changes(query = {})`
- `countChanges()`
- `applyBulkChanges()`
- `applyChange(changeId)`
### Environments
- `currentEnvironment()`
- `createEnvironment(body)`
- `environments()`
- `updateEnvironment(environmentId, body)`
- `apiKeys()`
- `regenerateApiKeys()`
- `updateWidgetSettings(body)`
### Events
- `triggerEvent(body)`
- `triggerBulkEvent(body)`
- `broadcastEvent(body)`
- `cancelTriggeredEvent(transactionId)`
### Execution Details
- `executionDetails(query = {})`
### Feeds
- `createFeed(body)`
- `feeds()`
- `deleteFeed(feedId)`
### Inbound Parse
- `validateMxRecordSetupForInboundParse()`
### Integrations
- `integrations()`
- `createIntegration(body)`
- `activeIntegrations()`
- `webhookProviderStatus(providerId)`
- `updateIntegration(integrationId, body)`
- `deleteIntegration(integrationId)`
- `channelLimit(channelType)`
- `inAppStatus()`
### Layouts
- `createLayout(body) `
- `layouts(query = {})`
- `layout(layoutId)`
- `deleteLayout(layoutId)`
- `updateLayout(layoutId, body)`
- `makeDefaultLayout(layoutId)`
### Messages
- `messages(query = {})`
- `deleteMessage(messageId)`
### Notification Groups
- `createNotificationGroup(body)`
- `notificationGroups()`
### Notification Templates
- `notificationTemplates(query = {})`
- `createNotificationTemplate(body)`
- `updateNotificationTemplate(templateId, body)`
- `deleteNotificationTemplate(templateId)`
- `notificationTemplate(templateId)`
- `notificationTemplateBlueprint(templateId)`
- `createNotificationTemplateBlueprint(templateId)`
- `updateNotificationTemplateStatus(templateId, body)`
### Notification
- `notifications(query = {})`
- `notificationsStats()`
- `notificationsGraphStats(query = {})`
- `notification(notificationId)`
### Subscribers
- `subscribers(query = {}) `
- `createSubscriber(body)`
- `createSubscriberBulk(body)`
- `subscriber(subscriberId)`
- `updateSubscriber(subscriberId, body)`
- `deleteSubscriber(subscriberId)`
- `updateSubscriberCredentials(subscriberId, body)`
- `updateSubscriberOnlineStatus(subscriberId, body)`
- `subscriberPreferences(subscriberId)`
- `updateSubscriberPreference(subscriberId, templateId, body)`
- `subscriberNotificationFeed(subscriberId, query = {})`
- `subscriberUnseenNotificationCount(subscriberId, query = {})`
- `markSubscriberFeedSeen(subscriberId, body)`
- `markMessageActionSeen(subscriberId, messageId, type)`
### Topics
- `createTopic(body)`
- `filterTopics(page, pageSize, key)`
- `addSubscribers(topicKey, body)`
- `removeSubscribers(topicKey, body)`
- `checkSubscriber(topicKey, externalSubscriberId)`
- `topic(topicKey)`
- `renameTopic(topicKey, body)`
- `deleteTopic(topicKey)`
### Blueprints
- `getBlueprintsByCategory()`
- `getBlueprint(templateId)`
### Tenants
- `getTenants(page, limit)`
- `createTenant(body)`
- `getTenant(identifier)`
- `updateTenant(identifier)`
- `deleteTenant(identifier)`
### Organizations
- `createOrganization(body)`
- `fetchAllOrganizations()`
- `updateOrganizationName(body)`
- `fetchCurrentOrganization()`
- `removeMemberWithId(identifier)`
- `updateMemberRole(identifier, body)`
- `fetchMembersOfOrganization()`
- `updateOrganizationBrand(body)`
### Workflow Override
- `createWorkflowOverride(createWorkflowOverrideRequest)`
- `getWorkflowOverrides(getWorkflowOverrideRequest)`
- `getWorkflowOverride(workflowId, tenantId)`
- `getWorkflowOverrideById(overrideId)`
- `updateWorkflowOverride(workflowId, tenantId)`
- `updateWorkflowOverrideById(overrideId)`
- `deleteWorkflowOverride(overrideId)`
### For more information about these methods and their parameters, see the [API documentation](https://docs.novu.co/api-reference/overview).
## Contributing
Feature requests, bug reports and pull requests are welcome. Please create an [issue](https://github.com/novuhq/novu-kotlin/issues).
## Support and Feedback
Be sure to visit the Novu official [documentation website](https://docs.novu.co/docs) for additional information about our API.
If you need additional assistance, join our Discord server [here](https://discord.novu.co).
## License
Novu Kotlin SDK is licensed under the MIT License - see the [LICENSE](https://github.com/novuhq/novu-kotlin/blob/main/LICENSE.md) file for details.
## Contributors