![Banner image](https://user-images.githubusercontent.com/10284570/173569848-c624317f-42b1-45a6-ab09-f0ea3c247648.png)

# n8n-nodes-clash-royale

This is an n8n community node for interacting with the Clash Royale API. It provides functionality to retrieve clan information, river race logs, and current river race data from the Clash Royale game.

[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.

[Installation](#installation)  
[Operations](#operations)  
[Credentials](#credentials)  
[Resources](#resources)  

## Installation

Follow these steps to install the node package in your n8n instance:

### In an existing n8n installation

1. Go to **Settings > Community Nodes**
2. Select **Install**
3. Enter `n8n-nodes-clash-royale` in **Enter npm package name**
4. Install the node package

### Installing the node package locally

If you want to install the package locally for development:

```bash
# Clone the repository
git clone https://github.com/<...>/n8n-nodes-clash-royale.git

# Install dependencies
cd n8n-nodes-clash-royale
pnpm install

# Build the code
pnpm build

# Link to n8n
npm link

# In your n8n root directory
cd /path/to/n8n
npm link n8n-nodes-clash-royale
```

## Operations

### Clan

* **Get River Race Log**: Retrieves the river race log for a clan
* **Get Current River Race**: Retrieves information about the current river race

## Credentials

To use this node, you need to create an API key from the [Clash Royale Developer Portal](https://developer.clashroyale.com).

1. Create an account on https://developer.clashroyale.com
2. Create a new API key
3. Add your IP address to the allowlist
4. Copy the API token

## Resources

* [Clash Royale API Documentation](https://developer.clashroyale.com/api-docs/index.html)
* [n8n Community Nodes Documentation](https://docs.n8n.io/integrations/community-nodes/)

## Development

If you want to contribute to this node:

1. Clone the repository
2. Install dependencies with `pnpm install`
3. Start development mode with `pnpm dev`
4. Make your changes
5. Build with `pnpm build`
6. Test your changes in n8n

## More information

Refer to our [documentation on creating nodes](https://docs.n8n.io/integrations/creating-nodes/) for detailed information on building your own nodes.

## License

[MIT](https://github.com/n8n-io/n8n-nodes-starter/blob/master/LICENSE.md)
