ExUserCheck
ExUserCheck is an Elixir client for the UserCheck API, enabling developers to verify and assess the validity and risk factors of email addresses and domains.
Features
- 🔍 Email Validation: Determine if an email address is valid and assess associated risk factors.
- 🌍 Domain Verification: Check if a domain is associated with disposable email providers, has valid MX records, and more.
- ⚡ Built with Req: Simple and efficient HTTP requests.
-
🏗 Typed Structs: Automatic deserialization with
ExConstructor.
Installation
Add ex_user_check to your list of dependencies in mix.exs:
def deps do
[
{:ex_user_check, "~> 0.2.1"}
]
endConfiguration
Set up your UserCheck API key in your application's configuration.
It's recommended to store sensitive information like API keys in environment variables or secret configuration files.
Example: config/runtime.exs
import Config
config :ex_user_check, api_key: System.fetch_env!("USERCHECK_API_KEY")Usage
📧 Email Validation
To validate an email address and retrieve risk assessment details:
iex> ExUserCheck.Emails.check("user@example.com")
{:ok, %ExUserCheck.Email{valid: true, disposable: false, spam: false, ...}}🌐 Domain Verification
To check if a domain is associated with disposable email providers and assess its validity:
iex> ExUserCheck.Domains.check("example.com")
{:ok, %ExUserCheck.Domain{disposable: false, mx: true, public_domain: false, ...}}Documentation
📖 Full documentation is available at HexDocs.
Contributing
We welcome contributions! 🎉 To contribute:
- Fork the repository.
-
Create a feature branch:
git checkout -b feature-branch - Make your changes.
-
Run tests to ensure everything is working:
mix test -
Commit and push:
git commit -m "Added new feature" git push origin feature-branch - Open a pull request on GitHub. 🚀
License
📝 This project is licensed under the MIT License. See the LICENSE file for details.