> For the complete documentation index, see [llms.txt](https://docs.eternals.game/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eternals.game/gdk-documentation/cocos-creator/api-reference/ninetyeight-game-development-kit-cocos-creator/interfaces.md).

# Interfaces

**negdkcc**

***

negdkcc / INEGdk

## Interface: INEGdk

Defined in: [interface/INEGdk.ts:58](https://github.com/EternalsGame/universal-sdk/blob/7b1076b6b36dd7c5b65f4a2f518d40773314a555/gdk/cocos-creator/assets/negdk/scripts/interface/INEGdk.ts#L58)

Represents the interface for the Game Development Kit (GDK).\
Provides methods for initializing the GDK, logging in, managing game profiles, and interacting with the game server.

### Methods

#### buyShopPack()

> **buyShopPack**(`packId`, `amount`, `currency`, `callback`): `void`

Defined in: [interface/INEGdk.ts:189](https://github.com/EternalsGame/universal-sdk/blob/7b1076b6b36dd7c5b65f4a2f518d40773314a555/gdk/cocos-creator/assets/negdk/scripts/interface/INEGdk.ts#L189)

Purchases a shop pack.

**Parameters**

**packId**

`number`

The ID of the shop pack to purchase.

**amount**

`number`

The amount to purchase.

**currency**

`string`

The currency to use for the purchase.

**callback**

`NEShopBuyCallback`

A callback function to handle the purchase result.

**Returns**

`void`

***

#### createWallet()

> **createWallet**(): `string`

Defined in: [interface/INEGdk.ts:71](https://github.com/EternalsGame/universal-sdk/blob/7b1076b6b36dd7c5b65f4a2f518d40773314a555/gdk/cocos-creator/assets/negdk/scripts/interface/INEGdk.ts#L71)

Creates a new wallet and returns the seed phrase.

**Returns**

`string`

The generated seed phrase.

***

#### getAddress()

> **getAddress**(): `string`

Defined in: [interface/INEGdk.ts:156](https://github.com/EternalsGame/universal-sdk/blob/7b1076b6b36dd7c5b65f4a2f518d40773314a555/gdk/cocos-creator/assets/negdk/scripts/interface/INEGdk.ts#L156)

Retrieves the player's address.

**Returns**

`string`

The player's address.

***

#### getAuthToken()

> **getAuthToken**(): `string`

Defined in: [interface/INEGdk.ts:150](https://github.com/EternalsGame/universal-sdk/blob/7b1076b6b36dd7c5b65f4a2f518d40773314a555/gdk/cocos-creator/assets/negdk/scripts/interface/INEGdk.ts#L150)

Retrieves the authentication token.

**Returns**

`string`

The authentication token.

***

#### getGameProfile()

> **getGameProfile**(): `NEGameProfile`

Defined in: [interface/INEGdk.ts:144](https://github.com/EternalsGame/universal-sdk/blob/7b1076b6b36dd7c5b65f4a2f518d40773314a555/gdk/cocos-creator/assets/negdk/scripts/interface/INEGdk.ts#L144)

Retrieves the player's game profile.

**Returns**

`NEGameProfile`

The player's game profile.

***

#### getProvider()

> **getProvider**(): `string`

Defined in: [interface/INEGdk.ts:138](https://github.com/EternalsGame/universal-sdk/blob/7b1076b6b36dd7c5b65f4a2f518d40773314a555/gdk/cocos-creator/assets/negdk/scripts/interface/INEGdk.ts#L138)

Retrieves the current provider being used for authentication.

**Returns**

`string`

The provider name (e.g., "google", "facebook").

***

#### initialize()

> **initialize**(`config`, `callback`): `void`

Defined in: [interface/INEGdk.ts:65](https://github.com/EternalsGame/universal-sdk/blob/7b1076b6b36dd7c5b65f4a2f518d40773314a555/gdk/cocos-creator/assets/negdk/scripts/interface/INEGdk.ts#L65)

Initializes the GDK with the provided configuration.

**Parameters**

**config**

`NEGdkConfig`

The configuration to initialize the GDK with.

**callback**

`NEInitCallback`

A callback function that will be invoked after initialization is complete.

**Returns**

`void`

***

#### isLoggedIn()

> **isLoggedIn**(): `boolean`

Defined in: [interface/INEGdk.ts:132](https://github.com/EternalsGame/universal-sdk/blob/7b1076b6b36dd7c5b65f4a2f518d40773314a555/gdk/cocos-creator/assets/negdk/scripts/interface/INEGdk.ts#L132)

Checks if the player is logged in.

**Returns**

`boolean`

`true` if the player is logged in, `false` otherwise.

***

#### isLoginCacheExpired()

> **isLoginCacheExpired**(): `boolean`

Defined in: [interface/INEGdk.ts:126](https://github.com/EternalsGame/universal-sdk/blob/7b1076b6b36dd7c5b65f4a2f518d40773314a555/gdk/cocos-creator/assets/negdk/scripts/interface/INEGdk.ts#L126)

Checks if the login cache is expired

**Returns**

`boolean`

`true` the login cache has expired or there is no login data in cache, `false` otherwise.

***

#### loginWithApple()

> **loginWithApple**(`callback`): `void`

Defined in: [interface/INEGdk.ts:115](https://github.com/EternalsGame/universal-sdk/blob/7b1076b6b36dd7c5b65f4a2f518d40773314a555/gdk/cocos-creator/assets/negdk/scripts/interface/INEGdk.ts#L115)

Logs in using Apple authentication.

**Parameters**

**callback**

`NELoginCallback`

A callback function that will be invoked with the login result.

**Returns**

`void`

***

#### loginWithEmail()

> **loginWithEmail**(`callback`): `void`

Defined in: [interface/INEGdk.ts:109](https://github.com/EternalsGame/universal-sdk/blob/7b1076b6b36dd7c5b65f4a2f518d40773314a555/gdk/cocos-creator/assets/negdk/scripts/interface/INEGdk.ts#L109)

Logs in using Email authentication.

**Parameters**

**callback**

`NELoginCallback`

A callback function that will be invoked with the login result.

**Returns**

`void`

***

#### loginWithFacebook()

> **loginWithFacebook**(`callback`): `void`

Defined in: [interface/INEGdk.ts:97](https://github.com/EternalsGame/universal-sdk/blob/7b1076b6b36dd7c5b65f4a2f518d40773314a555/gdk/cocos-creator/assets/negdk/scripts/interface/INEGdk.ts#L97)

Logs in using Facebook authentication.

**Parameters**

**callback**

`NELoginCallback`

A callback function that will be invoked with the login result.

**Returns**

`void`

***

#### loginWithGoogle()

> **loginWithGoogle**(`callback`): `void`

Defined in: [interface/INEGdk.ts:91](https://github.com/EternalsGame/universal-sdk/blob/7b1076b6b36dd7c5b65f4a2f518d40773314a555/gdk/cocos-creator/assets/negdk/scripts/interface/INEGdk.ts#L91)

Logs in using Google authentication.

**Parameters**

**callback**

`NELoginCallback`

A callback function that will be invoked with the login result.

**Returns**

`void`

***

#### loginWithPhrase()

> **loginWithPhrase**(`phrase`, `callback`): `void`

Defined in: [interface/INEGdk.ts:78](https://github.com/EternalsGame/universal-sdk/blob/7b1076b6b36dd7c5b65f4a2f518d40773314a555/gdk/cocos-creator/assets/negdk/scripts/interface/INEGdk.ts#L78)

Logs in using a phrase (e.g., seed phrase).

**Parameters**

**phrase**

`string`

The login phrase (seed phrase).

**callback**

`NELoginCallback`

A callback function that will be invoked with the login result.

**Returns**

`void`

***

#### loginWithProvider()

> **loginWithProvider**(`provider`, `callback`): `void`

Defined in: [interface/INEGdk.ts:85](https://github.com/EternalsGame/universal-sdk/blob/7b1076b6b36dd7c5b65f4a2f518d40773314a555/gdk/cocos-creator/assets/negdk/scripts/interface/INEGdk.ts#L85)

Logs in using a specific provider (e.g., Google, Facebook).

**Parameters**

**provider**

`string`

The provider name (e.g., "google", "facebook").

**callback**

`NELoginCallback`

A callback function that will be invoked with the login result.

**Returns**

`void`

***

#### loginWithTelegram()

> **loginWithTelegram**(`callback`): `void`

Defined in: [interface/INEGdk.ts:103](https://github.com/EternalsGame/universal-sdk/blob/7b1076b6b36dd7c5b65f4a2f518d40773314a555/gdk/cocos-creator/assets/negdk/scripts/interface/INEGdk.ts#L103)

Logs in using Telegram authentication.

**Parameters**

**callback**

`NELoginCallback`

A callback function that will be invoked with the login result.

**Returns**

`void`

***

#### logout()

> **logout**(): `void`

Defined in: [interface/INEGdk.ts:120](https://github.com/EternalsGame/universal-sdk/blob/7b1076b6b36dd7c5b65f4a2f518d40773314a555/gdk/cocos-creator/assets/negdk/scripts/interface/INEGdk.ts#L120)

Logs the player out of the system.

**Returns**

`void`

***

#### requestGameProfile()

> **requestGameProfile**(`callback`): `void`

Defined in: [interface/INEGdk.ts:162](https://github.com/EternalsGame/universal-sdk/blob/7b1076b6b36dd7c5b65f4a2f518d40773314a555/gdk/cocos-creator/assets/negdk/scripts/interface/INEGdk.ts#L162)

Requests the player's game profile.

**Parameters**

**callback**

`NEGameProfileCallback`

A callback function to handle the result.

**Returns**

`void`

***

#### requestShopInfo()

> **requestShopInfo**(`callback`): `void`

Defined in: [interface/INEGdk.ts:180](https://github.com/EternalsGame/universal-sdk/blob/7b1076b6b36dd7c5b65f4a2f518d40773314a555/gdk/cocos-creator/assets/negdk/scripts/interface/INEGdk.ts#L180)

Requests the available shop information.

**Parameters**

**callback**

`NEShopInfoCallback`

A callback function to handle the result.

**Returns**

`void`

***

#### requestUserBalances()

> **requestUserBalances**(`callback`): `void`

Defined in: [interface/INEGdk.ts:174](https://github.com/EternalsGame/universal-sdk/blob/7b1076b6b36dd7c5b65f4a2f518d40773314a555/gdk/cocos-creator/assets/negdk/scripts/interface/INEGdk.ts#L174)

Requests the player's balances.

**Parameters**

**callback**

`NEUserBalanceCallback`

A callback function to handle the result.

**Returns**

`void`

***

#### requestUserPets()

> **requestUserPets**(`callback`): `void`

Defined in: [interface/INEGdk.ts:168](https://github.com/EternalsGame/universal-sdk/blob/7b1076b6b36dd7c5b65f4a2f518d40773314a555/gdk/cocos-creator/assets/negdk/scripts/interface/INEGdk.ts#L168)

Requests the player's pets.

**Parameters**

**callback**

`NEUserPetCallback`

A callback function to handle the result.

**Returns**

`void`
