Web SDK
  • Home
  • Overview
  • Getting started
  • References
    • Authentication
    • Account
      • Users
    • Notifications
    • Bookmark
    • 2FA
    • Collection
    • Connection filters
    • Feed
    • File Upload
    • Invite
    • Messaging
    • Payment
    • Reviews
    • Search
    • Verification
      • Supported document type
      • List of expected ISO countries
    • Wallet
      • Withdrawal
  • Tutorial
  • Web API
Powered by GitBook
On this page
  • Create connection filter
  • Get connection filter
  • Update connection filter
  1. References

Connection filters

Connection filters are preferences set by the user to help determine who can interact with them, whether via chat or create a task, assign a task etc.

PreviousCollectionNextFeed

Last updated 11 months ago

The following services are available for the Connection filter.

Create connection filter

To create the connection filter, the user's id is needed, this can be gotten from the login response.

The IConnectionFilter is the payload required to create a connection filter.

IConnectionFilter

Field
Description
Type

event

The type of activity the connection filter preference is being setup for

see IConnectionEvents

key

The property for which the connection filter is to take effect

see IConnectionKeys

value

The resultant preference for the said property

string | number | string []

decider

The determinant which would help enforce the filter preference

see IConnectionFilterDecider

IConnectionKeys

IConnectionKeys refers to the properties which connection filter preferences can be effected upon. The following can be found as properties in .

Field
Description
Type

tags

The labels for the user

string []

tagCount

The total count of labels for a user

number

afroScore

The score of the user in the chainsite

number

IConnectionFilterDecider

The resolvers for the connection filter.

Field
Description

greater_than

This decider checks against the current value for that property, if its more than the expected value

less_than

This decider checks against the current value for that property, if its below the expected value

equal_to

This decider checks against the current value for that property, if its exactly the expected value

contains

This decider checks against the current value for that property, if the current value is made up, in part or whole of the expected value

between

This decider provides an option for a range, between a minimum expected value and maximum expected value

IConnectionEvents

IConnectionEvents refers to the activities for which connection filters can be set up and managed.

Field
Description

CREATE_CONVERSATION

Simply means, to initiate a chat, the sender must make sure they meet the preferences of the recipient

The authorization jwt token is required for this service.

export const createConnection = async (authToken: string, payload: IConnectionFilter) => {
  const connectionFilter: ResponseDto<IConnectionFilter> = await sdkInit.connection.create(authToken, payload);
};

Get connection filter

The PAKT SDK allows the user to fetch their preferences.

The authorization jwt token is required for this service.

See sample implementation

export const getConnectionFilterForUser = async (authToken: string) => {
  const connectionFilter: ResponseDto<IConnectionFilter> = await sdkInit.connection.getForAUser(authToken);
};

Update connection filter

Users can change their preferences at any point.

The authorization jwt token is required for this service.

See sample implementation below

export const updateConnectionFilter = async (authToken: string, payload: IConnectionFilter) => {
  const updatedConnection: ResponseDto<IConnectionFilter> = await sdkInit.connection.update(authToken, payload);
};
Create connection filter
Get connection filter
Update connection filter
IUser