cesar-jr/ci-social

There is no license information available for the latest version (v0.1.0) of this package.

A package for easy integration of OAuth2 logins

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/cesar-jr/ci-social

v0.1.0 2025-08-12 23:43 UTC

This package is auto-updated.

Last update: 2025-12-14 22:36:31 UTC


README

Packagist Version License PHP Version

CI Social is a CodeIgniter 4 package shamelessly copied from inspired by Laravel Socialite, enabling seamless OAuth authentication with multiple providers.

Currently supports: Bitbucket, Facebook, GitHub, GitLab, Google, LinkedIn, Slack, Twitch, and Twitter.

📦 Installation

Install via Composer:

composer require cesar-jr/ci-social

⚙️ Configuration

After installation, publish the configuration file:

php spark social:setup

This will create:

app/Config/Social.php

Add your provider credentials:

public array $providers = [
    'github' => [
        'client_id'     => 'your-client-id',
        'client_secret' => 'your-client-secret',
        'redirect'      => '/callback/github',
    ],
    'google' => [
        'client_id'     => 'your-client-id',
        'client_secret' => 'your-client-secret',
        'redirect'      => '/callback/google',
    ],
    // ... other providers
];

🚀 Basic Usage

You can use either the helper or service to start the OAuth flow.

1. Redirecting to the provider

Using helper:

return social('github')->redirect();

Using service:

return service('social')->driver('github')->redirect();

2. Getting the user after callback

$user = social('github')->user();

// Available user data
$user->getId();
$user->getName();
$user->getEmail();
$user->getAvatar();

🌐 Supported Providers

  • Bitbucket
  • Facebook
  • GitHub
  • GitLab
  • Google
  • LinkedIn
  • Slack
  • Twitch
  • Twitter

🤝 Contributing

Pull Requests are welcome!
If you find a bug, please open an issue with details and reproduction steps.

📄 License

This project is licensed under the MIT License.